필터 지우기
필터 지우기

How to save multiple Matlab figures in separate folders?

조회 수: 2 (최근 30일)
nancy
nancy 2018년 4월 4일
댓글: nancy 2018년 4월 13일
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