From: adel on
"Leslie McBrayer" <lmcbrayer(a)mathworks.com> wrote in message <hjn5qj$8ru$1(a)fred.mathworks.com>...
> > I tried to run the code from the matlab help in the section of avifile.
> >
> > t = linspace(0,2.5*pi,40);
> > fact = 10*sin(t);
> > fig=figure;
> > aviobj = avifile('example.avi')
> > [x,y,z] = peaks;
> > for k=1:length(fact)
> > h = surf(x,y,fact(k)*z);
> > axis([-3 3 -3 3 -80 80])
> > axis off
> > caxis([-90 90])
> > F = getframe(fig);
> > aviobj = addframe(aviobj,F);
> > end
> > close(fig)
> > aviobj = close(aviobj);
> >
> > It is indeed open an avi file, but I can't run it using windows media
> > player (and the player works on other avi files that were created with
> > flash)
> >
> > is it a bug in the help's example or am I am doing something wrong
>
> By default on Windows systems, avifile creates a compressed AVI file using
> the Indeo 5 codec -- but this codec is no longer shipped on many systems.
> Try creating an uncompressed AVI file:
>
> aviobj = avifile('example.avi','compression','None');
>
Try with this:
frame = getframe(gcf);
aviobj = addframe(aviobj,frame);

HTH