How do I make a video plot with multiple line that appears as it plots?
Show older comments
I have the following code:
writer_obj = VideoWriter('ms_GMD_video','MPEG-4');
open(writer_obj);
% parameters
x = 1:size(GMD,2);
ms_1 = GMD(1,x);
ms_2 = GMD(2,x);
ms_3 = GMD(3,x);
ms_4 = GMD(2,x);
ms_5 = GMD(5,x);
% create plotting figure
fig1 = figure(1);
% loop over all timepoints
for i = 1:length(x)
plot(x(i),ms_1(i))
hold on
plot(x(i),ms_2(i))
hold on
plot(x(i),ms_3(i))
hold on
plot(x(i),ms_4(i))
hold on
plot(x(i),ms_5(i))
hold on
axis([1 500 min(GMD,[],'all') max(GMD,[],'all')])
title('Dissimilarity Score')
F = getframe(fig1);
writeVideo(writer_obj, F);
end
close(writer_obj)
GMD is the input, and contains five lines that I would like to plot on a graph that changes over time.
I currently have it so that we only look at the first 500 time points as an example clip, which is fine.
But when I run this, there are no lines appearing on the graph.
Any help would be appreciated, thank you.
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots 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!