existing Matlab files opening blank on M1 MacBook Pro
29 views (last 30 days)
Show older comments
I have an M1 Macbook Pro running both Matlab 2022a and 2020b - this issue is the same with both Matlab editions. All of my existing m-files are blank when I open them or try to run them. I can create a new m-file, save, and run it, but my previous work needs to be opened in a text editor, and copied and pasted into an m-file for it to run. This is fine for a single file, but I use software based in Matlab that has hundreds of m-files. Any help, please? I am aware of Matlab/M1 compatibility problems, but haven't seen a problem similar to mine.
1 Comment
Jan
on 13 Sep 2022
M-files are text files. What does "blank" mean? Does opening the files in Matlab delete the text? What do you see in a text editor, if you open the same files? The procedure of opening a text file in another editor and copy&pasting it to an m-file in Matlab's editor is not meaningful. This is too magic.
My idea is that the files are not modified by opening them in the editor, but the display in the editor does not work correctly. Remember, that the editor would not work correctly without any M-files, because it uses Matlab's toolboxes also.
So please try it again: Create a text file in an editor, insert some simple commands and save it as "test.m". Now open this file in Matlab's editor and explain, what you see. Now close Matlab's editor and check in the external editor, if the file has been modified.
Are the m-files ASCII or Unicode encoded?
Answers (3)
Arasad
on 20 Sep 2022
I have had same experience with Matlab 2022a. What I noticed is that every time I restart the laptop (an M1 macbook air), the first time I run MATLAB, I will see the blank page for all the codes. If I close MATLAB and run it again, everything goes back to normal.
0 Comments
Aaron Kaye
on 5 Aug 2023
I have the same problem with Matlab 2022a.
1 Comment
Warwick
on 26 Jan 2024
I have exactly this problem and the same 'fix' of closing and restarting Matlab. I use an iMac Pro. For me the problem is recent, ie, I only noticed the problem a couple of months after I updated to 2023B. The duration for startup seems a lot slower than for previous versions.
Henghua Shen
on 1 Mar 2024
I had the same problem with 2023a. Sometimes I restarted Matlab, and it went back to normal, but not always. It usually happens when I open up by clicking the Matlab app icon. But it is normal when I open up by double clicking an any exiting m file from a folder. Dont know why but you can try:
- Restart Matlab; or
- Quite Matlab, go to your folder and double click a random m file.
Hope that helps.
0 Comments
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!