Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 3

Tutorial: Making “Movie” slides

using Matlab and Power Point


Chet Lo
University of Utah
7-7-03
Autocorrelation Function


function NDRmovie()

axis([-5 25 1 4000]);
set(gca,'nextplot','replacechildren');
L = 5000; LL = 10; L2 = L/2; n = 1000; s = 5;
b = randn((L/LL),1);
a = [];
for i=1:(L/LL),
if b(i) < 0,
temp = -1*ones(LL,1);
else
temp = ones(LL,1);
end
a = [a;temp];
end
aa = a((L2-n):(L2+n));
m = length(aa)
mm = 1:m;
j = 0;
cc = [];
for i = -n:s:n,
j = j+1;
bb = a((L2-n-i):(L2+n-i));
plot(mm,aa+20,mm,bb+12);
hold on;
plot(n+1,aa(n+1)+20,'r*',(n+1+i),bb(n+1+i)+12,'r*');
cc(j) = aa'*bb/(m/10);
plot((1:s:j*s),cc); The last command creates and avi
plot(j*s,cc(j),'r*');
hold off; That can be inserted directly in power
F(j) = getframe(gca); Point. The filename will be example2.avi
end
movie2avi(F,'example2','quality',100);

You might also like