how to name matfile from variable name
古いコメントを表示
I am trying to allow end users to name the .mat file that will save current settings as a preset.
What have tried so far is:
presetName = inputdlg({'Enter a name for the Preset'},'Preset');
%presetNameMat = strcat( presetName,'.mat');
save('presetName');
SaveUserSettings(handles);
Which saves everything in a file called presetName.mat - and not a .mat file named from the variable presetName. If I try and pass the value instead I get : Error using save Argument must contain a string.
採用された回答
その他の回答 (1 件)
Shameer Parmar
2016 年 6 月 10 日
Hi Kev111,
In your code, simply replace the line
save('presetName');
with
save(char(presetName));
and try..
カテゴリ
ヘルプ センター および File Exchange で Workspace Variables and MAT Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!