Problem running and editing Matlab scripts

32 views (last 30 days)
Michael
Michael on 21 Mar 2014
Commented: asiya on 25 Jan 2016
Recently I began having a problem with Matlab where I'm unable to open and edit or run a script without getting an error message from Matlab editor saying,
"Error writing [File I'm trying to run/save] [Location of file on disk] (The process cannot access the file because it is being used by another process)".
This only happens after I've opened any saved file and edited it. After editing I cannot run or save the file without getting this error message. I can however start a new file and am able to both save it and run it multiple times without any problems. As soon as I close and reopen it again, I get the error message.
Is there something I accidentally changed? I have checked all the permissions in Windows and I should have no problem reading or writing files.
Matlab R2013a, Windows 7 Enterprise
  3 Comments
Michael
Michael on 22 Mar 2014
I'm not having problems accessing the file or editing it, the problem occurs when I try to save or run the script after I've reopened it in the editor. Neither closing down Matlab nor restarting my computer fixes the problem. I checked and all the files have full permissions. I've also run Matlab as an administrator and this has no effect.
Star Strider
Star Strider on 22 Mar 2014
Edited: Star Strider on 22 Mar 2014
The only diagnostic I can think of is to open Task Manager to see if any other application could be open that might access ‘.m’ files. Does any other application associate with ‘.m’ files?
It may be time to ask Support for help.

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 22 Mar 2014
What is the folder of the file? Is it under c:\Program Files? If so, you're out of luck. If not, what is the folder? There are other folders that you're supposed to be able to write into but sometimes can't (like c:\ProgramData) and others that you think you should be able to but can't (like c:\users).
Close MATLAB and type Ctrl-Shift-Esc. Click the process tab. Do you still see an instance of MATLAB running?
If you don't see it, then you need to download "unlocker" http://download.cnet.com/Unlocker/3000-2248_4-10493998.html. Install that and when you get a file collision it will tell you what's got the file locked and give you the opportunity to pry it's grip off your file. Then once you see what other process has locked your file then maybe you can do something to avoid it in the future.
  7 Comments
Image Analyst
Image Analyst on 24 Mar 2014
I've run out of ideas. You might have to call the Mathworks. They can set up a Webex session with you, and drive your computer, and solve it for you.
asiya
asiya on 25 Jan 2016
I had the same issue, while trying different options I found that command+0 helped me to get out of that freeze.

Sign in to comment.


Michael
Michael on 22 May 2014
I contacted the Mathworks service department and they advised me to upgrade to R2014a, which fixed the problem.

Categories

Find more on Startup and Shutdown 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!