필터 지우기
필터 지우기

writeVideo function not accessible from appdesign (only from script)

조회 수: 2 (최근 30일)
Jannis
Jannis 2018년 7월 27일
댓글: Jannis 2018년 7월 31일
Using MATLAB 2018a, I build an appdesign interface that should create a video file.
When I execute the app, the line:
writeVideo(vid,frame);
throws the error: Undefined function or variable 'writeVideo'. However, the very same code, executed outside appdesign (in a script) runs perfectly. I also verified whether writeVideo is accessible from the app by writing
which writeVideo
writeVideo(vid,frame);
which gave me the correct location of the writeVideo method:
/Applications/MATLAB_R2018a.app/toolbox/matlab/audiovideo/@VideoWriter/VideoWriter.m % VideoWriter method
However, the next line still throws the aforementioned error. I cannot get my head around how this could be logically possible.
Many thanks for any ideas!
  댓글 수: 6
Walter Roberson
Walter Roberson 2018년 7월 31일
One thing I would wonder about is whether the MATLAB path is somehow getting clobbered.
Jannis
Jannis 2018년 7월 31일
I could resolve the problem. I had an error further down in my code where I was iterating over a 2D cell of vids, so as: writeVideo(vid_cell{2,1},frame). However what still confuses me that this mistake was done after the line that threw the error, in both code and execution time. I never had that before in MATLAB, is it just coincidence or may it be due to some compiling in appdesign?
The methods(vid) test gave me the right result, so as which writeVideo did. Interestingly open writeVideo threw an error (I guess that's expected since it is only defined inside VideoWriter?)

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by