Matlab R2013a wont open files in Editor.

Hi,
I've just installed Matlab R2013a (32bit student edition) on my computer but am having trouble opening files. If I double click on an .m file in the current folder list on the left of the main screen, all I see is a little cursor in the top left corner spinning around but nothing else happens (waited over an hour to check if it was just being slow to respond).
If I click the 'New Script' button, the Editor opens fine and I can create a new file and save it. However if I then try and open that file again, it just hangs as mentioned above.
If I use the Open button, then any files in the 'recent files' list open fine (i.e. any I have just saved). However if I try to select a file not in the recent files list by clicking 'open...', an explorer window opens and I can select the file I want to open. However when I select the file I want, the explorer windows closes and nothing else happens except that I can no longer click the 'open' button and after 5 minutes or so Matlab hangs completely and I have to force quit it.
I have tried completely reinstalling MATLAB, but that didn't help - still have the same issue. I've also tried updating Java, but that made no difference either.
I do have Matlab r2010a installed which works fine.
I am using Windows 7 x64.

9 Comments

What happens if you run:
edit yourMATLABFilename.m
That works fine. The editor opens and displays the file correctly.
Interesting... And:
open yourMATLABFilename.m
?
that causes Matlab to hang.
What is the output from:
which -all open %?
This:
C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\matlab\general\open.m
C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\matlab\graph2d\@scribehandle\open.m % scribehandle method
C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\matlab\iofun\@serial\open.m % serial method
C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\instrument\instrument\@icdevice\open.m % icdevice method
C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\shared\instrument\@instrument\open.m % instrument method
C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\sl3d\sl3d\@vrworld\open.m % vrworld method
C:\Program Files (x86)\MATLAB\R2013a Student\toolbox\simulink\simulink\upgradeadvisor\@UpgradeAdvisor\open.p % UpgradeAdvisor method
I have just tried installing it on my desktop (was using laptop before). I have the same issue there.
To test out the problem, I edited the 'open.m' file to add fprintf statements to see where it gets up to before it hangs. It reaches the following line:
[~, openAction] = finfo(fullpath);
But gets no further than that.
I have tried running the following script to test if finfo is indeed the issue:
file = 'E:\<file path obscured>\TwD.m'
finfo(file);
And indeed matlab hangs when calling finfo()
Further testing. I have edited the finfo.m file to see where in that function Matlab reaches using fprintf statements.
It reaches here:
if any(strcmp(['.' ext], matlab.io.internal.xlsreadSupportedExtensions)) || ...
any(strcmp(ext, ...
{'avi', ... % retaining avi file checks for backwards compatibility
'au' , 'snd', 'wav', ... % retaining au,snd,wav file checks for backwards compatibility
'csv', 'dat', 'dlm', 'tab', ... % text files
'wk1', 'ods', ... % other worksheet files
'im'})) % image files (see getExtension below)
at which point the if statement returns false and it jumps to
else % for unknown file types :
At which point it crashes. Its strange that finfo sees MATLAB's default file type (.m) as a 'unknown file type'
Result!
I commented out this line (Line 113) from finfo.m:
[ext, description] = getVideoInfo(filename,ext);
And open now works fine. So does double clicking on files.
So the question no is, why do those lines cause MATLAB to hang?

Sign in to comment.

Answers (3)

Ziemowit Laski
Ziemowit Laski on 7 Sep 2016
Edited: Ziemowit Laski on 7 Sep 2016
This is still a a problem with MATLAB 2016a (64-bit version). Any word on a real (MathWorks) fix?
In 2016a, the offending command is on line 186 of finfo.m.
hi Tom, thanks for posting. i had similar problems with R2013a and your suggested fixed worked. i had to comment out lines associated with audio and video files. your approach is on point.
HI, i have installed R2013a and having the same problem.. were you able to find a solution for this? (matlab stops working when i double click a .m file to open).
is it solvable by commenting out the line (Line 113) from finfo.m: ??
[ext, description] = getVideoInfo(filename,ext)
if so, can you please explain how to get the finfo.m edited? when searched, i found 3 finfo.m files among Matlab installation.
Please help thank you

3 Comments

It was the file:
<matlab installation directory>\toolbox\matlab\general\finfo.m
commenting out line 113 fixed it on both my laptop and desktop.
Hi Thomas,
But I just tried to edit the file using Notepad++. When I want to save the changes, it refuses and says: "Please check if this file is opened in another program". So the changes cannot be saved. Do you know another way to edit the file? Thank you very much.
I am trying to open the editor from matlabR2012a.. But each time I see the error message: error using open (line 163) failed to open matlab editor. What may be the problem?

Sign in to comment.

Categories

Asked:

on 7 Oct 2013

Edited:

on 7 Sep 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!