Saveas plot using name of imported data file.
古いコメントを表示
I have a data file named ex1.csv that I imported and plotted the data. I want to write a script which save this plot using same file name as input data file.
I have in workspace file name as
filev= 'I:\windows\users\me\desktop\data\ex1.csv'
which is imported some how, now I want to use something like
saveas(gcf,filev,'fig')
So that it saves ex1.fig file to exact same location as that of imported file with same file name and different extension(Ofcourse).
Above command does not work it tries to overwrite same file.
採用された回答
その他の回答 (1 件)
Mischa Kim
2014 年 6 月 13 日
Samir, how about
[pathstr,name,ext] = fileparts(filev);
f = fullfile(pathstr,name);
saveas(gcf,f)
カテゴリ
ヘルプ センター および File Exchange で Data Import and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!