|
Make sure you don't have the avi file open in another application (like Media Player). If you do, you will get exactly that message when you try to overwrite the open file.
"William Kong" <schoolsofthought@gmail.com> wrote in message <gf7ft5$p2s$1@fred.mathworks.com>...
> I am using Matlab to make some movies of simulations I am running. There are times when the movie feature works and there are times it doesn't. When I say it doesn't work, I do not mean a movie does not show up. All the plots show up to allow me to do screen captures to create a movie and it looks fine. The problem is that when the movie ends, no movie file is created and saved. In fact, at the end of the movie I get this error message:
>
> ??? Failed to open file.
> Error in ==> avifile.avifile at 171
> aviobj.FileHandle = avi('open',filename);
> Error in ==> movie2avi at 63
> avimov = avifile(filename,varargin{:});
> Error in ==> SRDMovie at 99
> movie2avi(G, 'SRD_movie');
>
> Sometimes I think the complexity (not length) of the simulation determines whether or not a movie file is created. When I simulate a "simple" scenario, everything works great and I get an avi file in the end. When I run something more complex, the movie craps out on me and I get the error message. However, the problem has also come up during simple simulations too. So I actually have no idea what's going wrong. I have also tried messing with the figure window size (I like to use large windows for better resolution), and that sometimes works if I make the window smaller.
>
> Anyone have some suggestions as to what I can do to make this movie stuff work? It feels like this movie function is not able to do screen captures of plots with a lot of information or something.
|