How to make animtion of 3D surface plot?
Mostra commenti meno recenti
I'm having my code here where I want to put animation. Can we show this animation wrt to any parameter?
2 Commenti
Constantino Carlos Reyes-Aldasoro
il 29 Giu 2020
To create an animation you will need to plot continuously different plots. Say you want to have 10 or 20 frames in your animation you could do this with a for loop:
for k=1:10
% use your code here, change the variables and surf each time
end
Now, you will need to grab each plot, so after each surf add the following:
drawnow
F(k) = getframe;
The variable F will contain your animation and then you can save as a video like this
v = VideoWriter('video_name'), 'MPEG-4');
open(v);
writeVideo(v,F);
close(v);
Hope this helps. If this does not solve your problem, please let me know. If it does, please accept the answer.
priya anjali
il 29 Giu 2020
Modificato: priya anjali
il 29 Giu 2020
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Animation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

