video of plot iterations in MATLAB
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
i am making a 3d plot using plot3 and i am also using quiver3 in it. i am running 100 iterations and pot keeps on updating. i am able to save the picture of the plot but how can i save or make video of the plot running iterations from matlab?
the picture after 100 iterations is as below:

0 Kommentare
Antworten (1)
KSSV
am 11 Feb. 2021
Bearbeitet: KSSV
am 11 Feb. 2021
Proceed something like shown below:
h = figure;
axis tight manual % this ensures that getframe() returns a consistent size
filename = 'testAnimated.gif';
for n = 1:0.1:10
% Draw plot for y = x.^n
x = 0:0.01:1;
y = 0:0.01:1;
z = x.^n;
plot3(x,y,z)
drawnow
% Capture the plot as an image
frame = getframe(h);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
% Write to the GIF File
if n == 1
imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
else
imwrite(imind,cm,filename,'gif','WriteMode','append');
end
end
1 Kommentar
Siehe auch
Kategorien
Mehr zu Geographic Plots 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!