How to read and save different variables in a matfile to another mat file
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sachin k p
am 21 Sep. 2018
Kommentiert: sachin k p
am 25 Sep. 2018
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 Kommentare
Akzeptierte Antwort
Stephen23
am 21 Sep. 2018
Bearbeitet: Stephen23
am 21 Sep. 2018
S = load('file1.mat','var1','var2');
save('file2.mat','-struct','S')
OR
S = load('file1.mat');
save('file2.mat','-struct','S','var1','var2')
5 Kommentare
Stephen23
am 24 Sep. 2018
@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')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!