I generated some plots using this code, but couldn't not be able to save them in a specific folder. How can i save them in a specific folder?

1 回表示 (過去 30 日間)
%Preparing for Plotting
%figure();
c = 0;
for j = 1: 2 : size(READ,2)
figure();
c = c+1;
plot(READ(:,j),READ(:,j+1),'k','LineWidth',5)
xlabel('1000/Temperature[1/K]') % x-axis label
ylabel('Ignition delay time (ms)') % y-axis label
end
end
  2 件のコメント
Adam
Adam 2018 年 8 月 24 日
So what is the question exactly?
Mr. 206
Mr. 206 2018 年 8 月 24 日
I want to know how to save those plots in a specific folder

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2018 年 8 月 24 日
For example,
savedir = fullfile(IGNfolder, 'figures');
figs = findobj(0, 'type', 'figure');
for K = 1 : length(figs)
thisfig = figs(K);
figno = double(thisfig);
filename = fullfile( savedir, sprintf('%g.png', figno) );
saveas(thisfig, filename);
end
  2 件のコメント
Mr. 206
Mr. 206 2018 年 8 月 24 日
Can you please specify where should i put this codes? As there are many loops which are actually making my tasks difficult.
Thanks for your reply.
Walter Roberson
Walter Roberson 2018 年 8 月 24 日
This could be put after the code you posted.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by