MATLAB Answers


how to let user define a name of avi file

Asked by Jakub
on 11 Apr 2013

Hi, im making avi file using movie2avi function. im wondering if there is a way to let user choose a name of that avi file...i tried input function but nothing worked so far...Thanks!!

  1 Comment

Why didn't input work? Can you post your code?

You also might want to look at uiputfile(), a GUI version of a file choose prompt.


No products are associated with this question.

1 Answer

Answer by per isakson
on 11 Apr 2013
Edited by per isakson
on 11 Apr 2013
 Accepted answer

"... nothing worked so far ..."

There are many ways to let the user provide a filename. This is the simplest I can think of.

    >> filespec = input('Please give a filename: ');
    Please give a filename: 'c:\temp\my.avi'
    >> disp(filespec)
    >> movie2avi( mov, filespec )
    Undefined function or variable 'mov'. 

I had not assigned a value to mov.

You must describe your problem in some more detail.

  1 Comment

on 12 Apr 2013

Thanks, its working. This is the part:

filespec = input('Name of avi file:', 's');
movie2avi(handles.F, filespec,'fps',2);

this is part of my code. problem was in name of variable - filespec. i was creating variable filename and all avi files were names filename.avi

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!