I am really a beginner to make a movie. I need to make a movie from a bunch of plots. How I can make it. I have 8 plots , which are y versus x. I want to make movie based on x to see how y change with increasing x.
Please consider my matlab file is as below:
x=[1 1.2 1.4 2 3 4 5 7 9 10];
y1=[2.8 7.6 10.9 12.3 15.0 21 12.3 14.5 42.4 47.7];
y2=1e8.*[0.599e-7 0.607e-7 0.343e-7 0.3e-7 0.873e-8 0.578e-8 0.298e-8 0.725e-9 0.14e-8 0.478e-9];
y3=10.*[0.136 0.544 0.834 1.03 0.366 0.314 0.703 0.207 0.696 0.164];
y4=10.*[0.26 0.21 0.17 0.25 0.31 0.34 0.16 0.15 0.13 0.31];
y5=....
y6=...
y7=...
y8=[6 7.6 10.9 12.3 15.0 21 12.3 19.5 42.4 47.7 ];
plot(x,y1)
hold on
plot(x,y2)
hold on
plot(x,y3)
hold on
plot(x,y4)
hold on
plot(x,y5)
hold on
plot(x,y6)
hold on
...
plot(x,y8)
I wrote following as a simple example but it does not work:
clc;clear all;
x=[1 1.2 1.4 2 3 4 5 7 9 10];
y = zeros(4,10);
y(1,:)=[2.8 7.6 10.9 12.3 15.0 21 12.3 14.5 42.4 47.7 ];
y(2,:)=1e8.*[0.599e-7 0.607e-7 0.343e-7 0.3e-7 0.873e-8 0.578e-8 0.298e-8 0.725e-9 0.14e-8 0.478e-9];
y(3,:)=10.*[0.136 0.544 0.834 1.03 0.366 0.314 0.703 0.207 0.696 0.164 ];
y(4,:)=10.*[0.26 0.21 0.17 0.25 0.31 0.34 0.16 0.15 0.13 0.31 ];
figure;
hold on
for n = 1:10
plot(x,y)
M(n)=getframe; % get frame from the current figure;
end
movie(M,10); %plays movie M 10 times
In a nut shell , How I can make a movie like Fig. 3.2: in the following link