And here is some matlab code that can be used to make animations.
Code: Select all
% This file should create the files required to make a eps movie in lyx
% using the animategraphics package. The call itself looks something like:
% \animategraphics[height=2.8in,autoplay,palindrome,loop]{8}
% {./movie1/fitmovie-1}{001}{025}
set(0,'defaultaxesfontsize',14);
set(0,'defaulttextfontsize',14);
linewidth=3;
directory='./movie-ex02/';
filenamestub='movie-';
makemovieflag=0; % Print files for movie? Set to 0 to test
a=[ [0:.1:1] [1.2:.2:3] ];
subplot(1,1,1)
for i=1:length(a)
subplot(1,1,1)
x=[0:.01:2]';
y=x.^a(i);
p=plot(x,y);
set(p,'LineWidth',linewidth)
axis([-0 2 0 8])
title([ 'Example Plot, y=x^\alpha, \alpha=' num2str(a(i),'%3.1f') ])
ylabel('y=f(x)')
xlabel('x')
% Must append 0s in front of small numbers, so start at 1000 and go up
filename=[ directory filenamestub num2str(i+1000,'%3.0f') '.eps' ];
str1=['print -depsc ' filename ];
% Must add bounding box to eps figures from matlab
str2=['!epsffit 0 0 50 50 ' directory filenamestub num2str(i+1000,'%3.0f') ...
'.eps ' directory 'fit' filenamestub num2str(i+1000,'%3.0f') '.eps' ];
pause(.1)
if makemovieflag % print files with 001 to n on the file name
eval(str1);
eval(str2);
end
end
% Make a slide for the handouts with some of the movie included
y1=x.^a(3);
y2=x.^a(11);
y3=x.^a(i);
p=plot(x,y1,'b',x,y2,'r--',x,y3,'g-.');
set(p,'LineWidth',linewidth)
title([ 'Example Plot, y=x^\alpha, \alpha=' num2str(a(2),'%3.1f') ', ' ...
num2str(a(11),'%3.1f') ', ' num2str(a(i),'%3.1f') ])
ylabel('y=f(x)')
xlabel('x')
legend(['\alpha=' num2str(a(3),'%3.1f')],['\alpha=' num2str(a(11),'%3.1f')], ...
['\alpha=' num2str(a(i),'%3.1f')],'Location','NorthWest')
str=['print -depsc ' directory filenamestub 'handout.eps' ];
if makemovieflag
eval(str)
end
[*]