How to save multiple Matlab figures in separate folders?

2 次查看(过去 30 天)
Hi,
I want to save each of multiple figures in separate folders.. What is the command that I can use?
For example: file1.fig will be saved in A folder, file2.fig will be saved in B folder.
How can I do this?
Thanks a lot..

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2018-4-4
编辑:Fangjun Jiang 2018-4-4
use fullfile() to specify the full path of the file and saveas().
  3 个评论
Fangjun Jiang
Fangjun Jiang 2018-4-4
Fig=plot(rand(1,10));
File=fullfile('c:\MyDirectory','FolderA','MyFigure.fig');
saveas(Fig,File,'fig');
nancy
nancy 2018-4-13
Thank you very much..
How can I add this code to my Matlab code?
Because; I study on double Y-axis as you can see below. I mean that what can I write instead of "File" ?
figure;[haxes,hline1,hline2] = plotyy(dat_s,M1K1_norm,dat_s,T); set(haxes(1),'XLim',[0 DATA],'LineWidth',1.5); set(haxes(2),'XLim',[0 DATA]); set(haxes(1),'YLim',[0 1.3], 'FontSize', 16); set(haxes(1),'YTick',[0:0.13:1.3]); set(haxes(2),'YLim',[-60 90], 'FontSize', 16); set(haxes(2),'YTick',[-60:15:90]) set(hline1,'Color','r','LineWidth',3); set(hline2,'Color','y','LineWidth',3); set(haxes, 'FontSize',15,'LineWidth',2)
hold on;
[haxes,hline1,hline2] = plotyy(dat_s,M1K2_norm,dat_s,T); set(haxes(1),'XLim',[0 DATA]); set(haxes(2),'XLim',[0 DATA]); set(haxes(1),'YLim',[0 1.3], 'FontSize', 16); set(haxes(1),'YTick',[0:0.13:1.3],'Ycolor', 'k'); set(haxes(2),'YLim',[-60 90], 'FontSize', 16); set(haxes(2),'YTick',[-60:15:90], 'Ycolor', 'k'); set(hline1,'Color','b','LineWidth',3); set(hline2,'Color','k','LineWidth',3); ylabel('Normalize Güç'); ylabel(haxes(2),'Sicaklik (C)'); title('test');xlabel('A'); set(haxes, 'FontSize',15,'LineWidth',2) legend('test'); grid

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by