Trouble Saving Data Structure
8 views (last 30 days)
Show older comments
I am processing fluorescence data and saving data structures with subject IDs and other relevant trial identifiers as well as several long vectors of signal and time data. I have saved many versions of these structures without ever having encountered a problem. Today, while trying to save another structure, I keep getting errors that say matlab is "unable to write file 'C:\Users ..." and then messages will pop up in the command line saying "An error was encountered while saving the command history" and "The desktop configuration was not saved successfully". I have saved many of these types of structures before, and never had an issue. As far as I know, there is nothing unique to this specific structure that would be causing the problem, and I have since tested it with structures I have saved successfully in the past and gotten the same error. Does anyone know what I can do to successfully save my data?
3 Comments
Steven Lord
on 4 Apr 2025
Okay. Is there already a file in that specific location? If so, please specify that full path to the file in a call to the fileattrib function with two outputs, as I've done below for one of the MATLAB function files included in MATLAB.
b = fullfile(matlabroot, 'toolbox', 'matlab', 'funfun','ode45.m')
[~,values] = fileattrib(b)
Looking at this output, if I were to try to write to the ode45.m file it ought to fail, as the values struct shows that no one should have permissions to Write to that file. I want to see if your file is read-only as well.
If the file doesn't exist, call fileattrib on the directory in which you're trying to save the file, again to see if that directory is read-only.
Answers (0)
See Also
Categories
Find more on Debugging and Analysis 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!