How to change .fig name when I use savefig

4 views (last 30 days)
Seok Min Lee
Seok Min Lee on 5 Sep 2020
Commented: Stephen23 on 5 Sep 2020
I want to save mat file to fig file
like this
```
I have 00001.mat , 000002.mat ... file
and I want to save file like 00001.fig, 000002.fig
There is my code
mat_file = dir
name = mat_file(3).name %setdata
[filename,fileformat] = strsplit(name,'.')
load(name)
mat2stft
[S,F,T] = stft(a)
h = pcolor(T,F,abs(S))
set(h,'EdgeColor','none');
axis tight off
stft2fig
figname = strcat(filename(1),'.fig')
savefig((figname))
  2 Comments
Seok Min Lee
Seok Min Lee on 5 Sep 2020
savefig((figname)) is error.. How to fix it!?
Stephen23
Stephen23 on 5 Sep 2020
"savefig((figname)) is error.. How to fix it!?"
That depends on what the error is. It might be that the location is write protected, or the name is not valid, or all sorts of things can prevent a file from being saved. We don't know what the reason is, because you did not show the error message.
Please show the complete error message. This means all of the red text.

Sign in to comment.

Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!