Save figure between each iteration

Hello there,
i want to ask whether its possible it to stop between each iteration and save the figure, i.e
i have
t=0:1.5:15
y=( some function );
so, when i plot the graph it will pause every iteration and save the figure before going to next plot. may i know how to make those possible, because i already hold on and pause , but it's only pause a bit and i cannot save the figure. thank you

답변 (1개)

Chad Greene
Chad Greene 2015년 1월 20일
편집: Chad Greene 2015년 1월 20일

1 개 추천

There's no need to pause anything if all you want to do is save figures. export_fig is better than saveas, but using standard Matlab functions try this:
x = 0:.1:1;
y = sin(x);
plot(x,y,'b-')
hold on;
for k = 1:length(x)
h = plot(x(k),y(k),'rx','markersize',40);
saveas(gcf,['figurenumber',num2str(k)],'png');
delete(h)
end

댓글 수: 1

m
m 2015년 1월 20일
thank you, i also found out i can use keyboard function.

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

카테고리

도움말 센터File Exchange에서 Desktop에 대해 자세히 알아보기

태그

질문:

m
m
2015년 1월 19일

댓글:

m
m
2015년 1월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by