How to display data after one iteration step

조회 수: 7 (최근 30일)
Veronika
Veronika 2014년 12월 2일
답변: Thorsten 2014년 12월 2일
Dear all,
I have code, which displays all iteration steps (data) into one figure, but I would like to display (save) for loop data after one iteration step (iteration step1 = figure(1), one iteration step2 = figure(2),...). It means after each change of variable j display one figure.
My code:
imdl = mk_common_model('d2d1c',16);
img_1 = mk_image(imdl);
figure
show_fem(img_1);
img_2 = img_1;
v = 0:0.1:1
idx = 1;
for j = 0:0.25:1
v(idx) = j;
['x-' num2str(j) '.^2+ (y- 0.5) .^2<0.1^2, ''x,' 'y,' 'z'];
select_fcn = inline('(x-j).^2+(y-0.5).^2<0.1^2','x','y','z');
img_2.elem_data = 1 + elem_select(img_2.fwd_model, select_fcn);
idx = idx + 1;
end
figure
show_fem(img_2);
vh = fwd_solve(img_1);
vi = fwd_solve(img_2);
img_3 = inv_solve (imdl,vh,vi);
figure
show_fem(img_3);
I think could be implement using cell , but I don´t have any idea how to do it.
Thank you, for any idea.

채택된 답변

Thorsten
Thorsten 2014년 12월 2일
Put a figure command and the command to show your image into your for loop.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by