How to display data after one iteration step
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Veronika
am 2 Dez. 2014
Beantwortet: Thorsten
am 2 Dez. 2014
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.
0 Kommentare
Akzeptierte Antwort
Thorsten
am 2 Dez. 2014
Put a figure command and the command to show your image into your for loop.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!