Passing variable filename to movie2avi

조회 수: 3 (최근 30일)
Neil Ryan
Neil Ryan 2014년 7월 9일
댓글: Ben11 2014년 7월 9일
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
Sara
Sara 2014년 7월 9일
what is the value of the variable "name"?

댓글을 달려면 로그인하십시오.

채택된 답변

Ben11
Ben11 2014년 7월 9일
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
Neil Ryan
Neil Ryan 2014년 7월 9일
Perfect! Thanks!
Ben11
Ben11 2014년 7월 9일
great!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by