Trouble Saving Data Structure

10 ビュー (過去 30 日間)
Will
Will 2025 年 4 月 4 日
コメント済み: Steven Lord 2025 年 4 月 4 日
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 件のコメント
Will
Will 2025 年 4 月 4 日
The full red text is as follows: "Error using save
Unable to write file 'C:\Users\dunnewa\Documents\MATLAB\Experimental Data\aa.mat'."
The other two messages are sometimes (in some errors, not all of them) displayed in black text underneath the error
Steven Lord
Steven Lord 2025 年 4 月 4 日
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')
b = '/MATLAB/toolbox/matlab/funfun/ode45.m'
[~,values] = fileattrib(b)
values = struct with fields:
Name: '/MATLAB/toolbox/matlab/funfun/ode45.m' archive: NaN system: NaN hidden: NaN directory: 0 UserRead: 1 UserWrite: 0 UserExecute: 0 GroupRead: 1 GroupWrite: 0 GroupExecute: 0 OtherRead: 1 OtherWrite: 0 OtherExecute: 0
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.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by