How do I save a video with subplot?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone!
I have a sequence of frames on which I have plotted two arrays in order to show the behaviour of a scenario using the subplot function. I used the videowriter function to save only the video, and so far I had no problems. Now I'd like to save a video with the two arrays displayed with subplot but it doesn' t seem to work. Is there some other function that I can use to show all my plots in the video? It seems that I may use the getframe function but so far i didn't understand how to deal with it. any other suggestions?
0 commentaires
Réponses (1)
Prashant Arora
le 8 Mar 2017
Hi Andrea,
You can refer to the code below to get started on getframe and video writer.
h = figure;
subplot(2,1,2);
plot(1:10);
subplot(2,1,1);
plot(5:15);
F = getframe(h);
v = VideoWriter('myFile.avi');
open(v);
writeVideo(v,F.cdata)
close(v);
0 commentaires
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!