Passing variable filename to movie2avi

3 Ansichten (letzte 30 Tage)
Neil Ryan
Neil Ryan am 9 Jul. 2014
Kommentiert: Ben11 am 9 Jul. 2014
Here's the basis for what I'm trying to do:
fname = inputdlg('Enter Filename without extension','Input');
name = strcat(fname,'.avi');
movie2avi(handles.movie, name,'fps',handles.fps,...
'compression','None')
This gives an error: "Invalid input arguments. Second input argument must be a filename." Is this a limitation of matlab that the argument has to be a string, and can't be a variable pointing to a string? If so, is there a way around this?
Thanks, Neil
  1 Kommentar
Sara
Sara am 9 Jul. 2014
what is the value of the variable "name"?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Ben11
Ben11 am 9 Jul. 2014
Maybe try this:
fname = inputdlg('Enter Filename without extension','Input');
name = strcat(fname,'.avi');
movie2avi(handles.movie, name{1},'fps',handles.fps,...
'compression','None')
Since the answer to the input dialog is stored in a cell array...
  2 Kommentare
Neil Ryan
Neil Ryan am 9 Jul. 2014
Perfect! Thanks!
Ben11
Ben11 am 9 Jul. 2014
great!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by