Error using save. Unable to write file
Show older comments
I randomly got the error descripted in the title. Suddenly Matlab had errors using my field structure. I have a code like
In.C=c;
In.D=d;
Par.E=e;
Par.F=f;
In=orderfields(In);
save('filename.mat','In','Par')
Out.A=a;
Out.B=b;
Out=orderfields(Out);
save('filename.mat','-append','Out')
and I get an error for the last line here. I have a similar program that I didnt touch and worked perfectly fine before, just as this ine, now it gives the same error too.
I already tried saving in v7.3 and I also restarted Matlab and amso the PC, nothing worked.
If it helps, before that I had trouble with Parallel Computing Toolbox, which shutted down after each iteration and restarted again.
I also reinstalled Matlab, same problem. And inbetween I had also some trouble starting Matlab saying I dont have a valid license file, but then suddenly it worked again and I could run the code once or twice before the same error occured again. But I should have a valid license, Matlab profile doesnt say anything.
Does somebody know whats wrong?
7 Comments
Dyuman Joshi
on 27 Mar 2024
Is that full error message you received? If not, then share the full error message i.e. all of the red text.
Does the error occur while saving any data or just this particular data only? If it occurs for this particular data only, please share the data so we can reproduce the error and provide suggestionsa accordingly.
Dennis Derewjanko
on 27 Mar 2024
Dyuman Joshi
on 27 Mar 2024
Dennis Derewjanko
on 27 Mar 2024
Damian Pietrus
on 27 Mar 2024
Are you encountering this error within a parfor loop for just in regular serial code?
Dennis Derewjanko
on 27 Mar 2024
Edited: Dennis Derewjanko
on 27 Mar 2024
Walter Roberson
on 27 Mar 2024
I recommend against using uiimport() . uiimport() is guessing that your .mat file is a text file, and then is failing to load the binary .mat file as text.
Answers (0)
Categories
Find more on File Operations 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!