automatically save multiple graphs

조회 수: 1(최근 30일)
Lepakshi Ramkiran
Lepakshi Ramkiran 2020년 3월 9일
댓글: Lepakshi Ramkiran 2020년 3월 10일
hello,
The following code works fine when the value of omega is an integer. But, when the omega is not an integer the files are being saved as fig0.1.png.... how do I overcome this problem?
for omega = 0:0.1:1
xt=xo*cos(omegan*t)+((xodot)/(omegan))*sin(omegan*t)+ds*((cos(omega.*t)-cos(omegan*t))/(1-(omega/omegan)^2));
plot(t,xt);
title(['\omega/\omega_n = ' num2str(omega) '/1'])
fig=figure;
destination='X:\fakepath\R';
print([destination,num2str(omega),'.png']);
close(fig);
end
  댓글 수: 2
Lepakshi Ramkiran
Lepakshi Ramkiran 2020년 3월 10일
Yup....got it. Thanks

댓글을 달려면 로그인하십시오.

답변(0개)

범주

Find more on Loops and Conditional Statements in Help Center and File Exchange

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by