From: Paul on
Hey... my understanding of how to convert a series of .fig files to an animation is based on the advice given to me in a previous post. Here is what I have, which is incorrect due to my unfamiliarity with structural arrays...

fh=figure;
open 1.fig;
M(1)=getframe(fh);
open 2.fig;
M(2)=getframe(fh);
open 3.fig;
M(3)=getframe(fh);
c=cat(1,M(:))
s=struct('frames',c)
movie(s)

Can anyone do a quick fix? Thanks so much...
From: us on
"Paul " <palex71(a)hotmail.com> wrote in message <i3c5f3$h8n$1(a)fred.mathworks.com>...
> Hey... my understanding of how to convert a series of .fig files to an animation is based on the advice given to me in a previous post. Here is what I have, which is incorrect due to my unfamiliarity with structural arrays...
>
> fh=figure;
> open 1.fig;
> M(1)=getframe(fh);
> open 2.fig;
> M(2)=getframe(fh);
> open 3.fig;
> M(3)=getframe(fh);
> c=cat(1,M(:))
> s=struct('frames',c)
> movie(s)
>
> Can anyone do a quick fix? Thanks so much...

well...
the pseudo-code did not include the STRUCT conversion...

http://www.mathworks.com/matlabcentral/newsreader/view_thread/288346#767822

in your code, simply use

movie(c);

us
From: Paul on
"us " <us(a)neurol.unizh.ch> wrote in message <i3c92o$s0f$1(a)fred.mathworks.com>...
> "Paul " <palex71(a)hotmail.com> wrote in message <i3c5f3$h8n$1(a)fred.mathworks.com>...
> > Hey... my understanding of how to convert a series of .fig files to an animation is based on the advice given to me in a previous post. Here is what I have, which is incorrect due to my unfamiliarity with structural arrays...
> >
> > fh=figure;
> > open 1.fig;
> > M(1)=getframe(fh);
> > open 2.fig;
> > M(2)=getframe(fh);
> > open 3.fig;
> > M(3)=getframe(fh);
> > c=cat(1,M(:))
> > s=struct('frames',c)
> > movie(s)
> >
> > Can anyone do a quick fix? Thanks so much...
>
> well...
> the pseudo-code did not include the STRUCT conversion...
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/288346#767822
>
> in your code, simply use
>
> movie(c);
>
> us


Removing the s=struct... line and using movie(c); didn't seem to work. A frame opened when the movie(c) line was executed, but nothing appeared within. Does anyone know what I might be missing? Thanks again..
From: Walter Roberson on
Paul wrote:
> "us " <us(a)neurol.unizh.ch> wrote in message
> <i3c92o$s0f$1(a)fred.mathworks.com>...
>> "Paul " <palex71(a)hotmail.com> wrote in message
>> <i3c5f3$h8n$1(a)fred.mathworks.com>...
>> > Hey... my understanding of how to convert a series of .fig files to
>> an animation is based on the advice given to me in a previous post.
>> Here is what I have, which is incorrect due to my unfamiliarity with
>> structural arrays...
>> > > fh=figure;
>> > open 1.fig;
>> > M(1)=getframe(fh);
>> > open 2.fig;
>> > M(2)=getframe(fh);
>> > open 3.fig;
>> > M(3)=getframe(fh);
>> > c=cat(1,M(:))
>> > s=struct('frames',c)
>> > movie(s)
>> > > Can anyone do a quick fix? Thanks so much...
>>
>> well...
>> the pseudo-code did not include the STRUCT conversion...
>>
>> http://www.mathworks.com/matlabcentral/newsreader/view_thread/288346#767822
>>
>>
>> in your code, simply use
>>
>> movie(c);
>>
>> us
>
>
> Removing the s=struct... line and using movie(c); didn't seem to work.
> A frame opened when the movie(c) line was executed, but nothing appeared
> within. Does anyone know what I might be missing? Thanks again..

Take another look at the movie documentation.

movie takes a movie structure such as is produced by getframe(). So just

movie(M)

"doc movie" has an explicit getframe example showing the transfer of the
getframe data right in to a movie call without any structure alteration.
From: us on
On Aug 5, 12:53 am, "Paul " <pale...(a)hotmail.com> wrote:
> "us " <u...(a)neurol.unizh.ch> wrote in message <i3c92o$s0...(a)fred.mathworks.com>...
> > "Paul " <pale...(a)hotmail.com> wrote in message <i3c5f3$h8...(a)fred.mathworks.com>...
> > > Hey... my understanding of how to convert a series of .fig files to an animation is based on the advice given to me in a previous post.  Here is what I have, which is incorrect due to my unfamiliarity with structural arrays...
>
> > > fh=figure;
> > > open 1.fig;
> > > M(1)=getframe(fh);
> > > open 2.fig;
> > > M(2)=getframe(fh);
> > > open 3.fig;
> > > M(3)=getframe(fh);
> > > c=cat(1,M(:))
> > > s=struct('frames',c)
> > > movie(s)
>
> > > Can anyone do a quick fix?  Thanks so much...
>
> > well...
> > the pseudo-code did not include the STRUCT conversion...
>
> >http://www.mathworks.com/matlabcentral/newsreader/view_thread/288346#...
>
> > in your code, simply use
>
> >      movie(c);
>
> > us
>
> Removing the s=struct... line and using movie(c); didn't seem to work.  A frame opened when the movie(c) line was executed, but nothing appeared within.  Does anyone know what I might be missing?  Thanks again..- Hide quoted text -
>
> - Show quoted text -

well...
let's look at your code, again

fh=figure; % <- this is NOT needed...
open 1.fig; % <- this opens a NEW figure with a different
handle, ie, ~FH...
m(1)=getframe(fh); % <- this collects data from the figure
FH, which is empty, of course...
% hence, try
m(1)=getframe(gcf); % <- always sample from the current
figure

us