Save frames while creating a video
Show older comments
I'm doing a video from a data array (ArrayVelocity). The data is composed the next way: files with Columns and rows (representing X and Y direction from the 2D image) and each file means an isntant of time.
The code goes as follows:
for i=1:size(ArrayVelocity,3) %Checks the lenght of the time vector
[x_1_range, x_2_range, matrixVmag] = buildMatrix(meanArray(:,1), meanArray(:,2), ArrayVelocity(:,colVmag,i)); %Brings the information from the array
txtTitle = "";
plotContour(time(i), x, y, matrixVmag, txtTitle); %Function to plot the data
%Creates the video
frame = getframe(gcf);
writeVideo(v,frame);
close
end
I want to get the image of each instant of time (or frame) and save them in a folder.
I'm stuck with that alrerady some time. I would appreciate your help!
Thanks :)
3 Comments
Geoff Hayes
on 25 Aug 2020
Is the problem with creating the video or do you want to also save each frame to file? Does the above code work so that a video is created correctly?
U A
on 25 Aug 2020
Geoff Hayes
on 26 Aug 2020
Accepted Answer
More Answers (0)
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!