How to save workspace except for one structure field?
4 ビュー (過去 30 日間)
古いコメントを表示
I want to save the workspace except for a variable and a field in a structure.
I know i can do this to not save a variable, but i want to also not save struct.field
save('Workspace.mat','-regexp','^(?!(VariableName)$).');
0 件のコメント
回答 (1 件)
pietro
2014 年 4 月 25 日
編集済み: per isakson
2014 年 7 月 29 日
Probably there is a shorter way to do it, but this method works:
a=1;
b=1;
c=1;
vars=who;
p=find(ismember(vars,'b')==0)
for i=1:length(p)
save('prova.mat',char(vars(p(i))));
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!