Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Saving AVI files

Subject: Saving AVI files

From: Brendan

Date: 16 Apr, 2010 15:39:21

Message: 1 of 2

Hi,
Just wondering, if I am using the avifile command to save my simulation as a file, is there a way I can change the name of the file outside the code? What I mean is, using:

aviobj = avifile('return_10.avi','compression','None'); %create AVI file with name ...return_10

It gets kind of annoying because each time I run the code I have to change the filename from say 'return_1' to 'return_2' etc etc. Is there a way to give the file a name after the code has run? I basically have a bunch of for loops solving ode's, posting the code would be irrelevant, I jus basically plot the trajectory of a body and want to save this as an AVI file.
Thanks
Brendan

Subject: Saving AVI files

From: Sean

Date: 16 Apr, 2010 17:08:21

Message: 2 of 2

"Brendan " <c_uboid88@hotmail.co.uk> wrote in message <hqa0b8$dkg$1@fred.mathworks.com>...
> Hi,
> Just wondering, if I am using the avifile command to save my simulation as a file, is there a way I can change the name of the file outside the code? What I mean is, using:
>
> aviobj = avifile('return_10.avi','compression','None'); %create AVI file with name ...return_10
>
> It gets kind of annoying because each time I run the code I have to change the filename from say 'return_1' to 'return_2' etc etc. Is there a way to give the file a name after the code has run? I basically have a bunch of for loops solving ode's, posting the code would be irrelevant, I jus basically plot the trajectory of a body and want to save this as an AVI file.
> Thanks
> Brendan

for i = 1:number_of_AVI_files_you_will_write
     file_name = ['record_' num2str(4, '%02i') '.avi'];
     aviobj = avifile(file_name,'compression','None');
end

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us