insert text in for loop operation
이전 댓글 표시
I intend to insert text to each image saved during for loop operation.
I have for loop runs from i = 1:1:200 ;
lets say for image saved duirng i = 1 iteration I need to insert ' t = 0 s' and t = 0.0002 s, t = 0.0004 s, t = 0.0006 s for images saved duirng i = 2, 3, 4 iterations respectively. Please help me with this ...
for i = 1:1:200
%% image processing
%% insert text
%% save image
end
채택된 답변
추가 답변 (1개)
The question is not clear yet. Where should ' t = 0 s' appear? As title of an axes?
for i = 1:200
%% image processing
%% insert text
%% save image
t = 0.0002 * i;
FigH = figure;
axes;
title(sprintf('t = %g s', t));
% Now "save" the image
end
What does "save"! means here? Print as PDF, a screenshot, a fig file? Maybe:
savefig(FigH, sprintf('Figure%04d.fig', i), 'compact')
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!