How to read and save different variables in a matfile to another mat file
1 回表示 (過去 30 日間)
古いコメントを表示
How to read two specific variables from a .mat file having different variables and save it to another .mat file without changing the variable name.
0 件のコメント
採用された回答
Stephen23
2018 年 9 月 21 日
編集済み: Stephen23
2018 年 9 月 21 日
S = load('file1.mat','var1','var2');
save('file2.mat','-struct','S')
OR
S = load('file1.mat');
save('file2.mat','-struct','S','var1','var2')
5 件のコメント
Stephen23
2018 年 9 月 24 日
@sachin k p: if the names are different then you could try the '-append' option, like this:
S = load('file1.mat','var1','var2');
save('file2.mat','-struct','S','-append')
その他の回答 (0 件)
参考
カテゴリ
Help Center および 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!