How can I specify a path to save MAT-file
2 views (last 30 days)
Show older comments
Hi, I am trying to import csv-file and save as mat-file. One thing I don't figure out is that the way to save mat file into a different folder from the *.m(that converts files).
[varX] = importfile(filename);
[path, name, ext] = fileparts(filename);
extention='.mat';
matname=[name extention];
save(matname) %QUESTION!! How to specify the folder?
0 Comments
Accepted Answer
Walter Roberson
on 1 Aug 2017
Edited: Walter Roberson
on 1 Aug 2017
[varX] = importfile(filename);
[filepath, name, ext] = fileparts(filename);
extention='.mat';
matname = fillefile(filepath, [name extention]);
save(matname, 'varX')
0 Comments
More Answers (1)
See Also
Categories
Find more on ワークスペース変数と MAT ファイル in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!