How can I open a file in a compiled application?
조회 수: 10 (최근 30일)
이전 댓글 표시
I have a trial license for the Matlab compiler. I would like to build an application to display .fig files. I have created an application that opens a Figure window. However, when I try to open a .fig file, I get an error message "Warning: The Open function cannot be used in compiled applications". Is this a limitation of the trial license, or does it apply to all compiled applications in general?
댓글 수: 1
답변 (2개)
Vincent Prevosto
2020년 1월 31일
- Create a file (e.g., FigViewer.m) with the code below:
[fileName,dirPath] = uigetfile('*.fig','Select a figure (.fig) file');
openfig(fullfile(dirPath,fileName));
- Then compile it in the main command window with the compiler:
mcc -m -v FigViewer.m
% or, version without prompt
mcc -e -v FigViewer.m
댓글 수: 0
Jan
2019년 7월 9일
The error message is clear in this point: You cannot use open in compiled applications. This is not a limitation by the trial version.
What about openfig?
댓글 수: 4
Jan
2019년 7월 11일
편집: Jan
2019년 7월 11일
Sorry; I guess I wasn't clear. There is no code. It's a figure window. The "Open File" button in the figure window, when clicked, causes a "File open" dialog to pop up, but when a file is selected and OK is clicked, nothing happens. In the terminal window from which the figure window compiled application was launched, I see the error message, "Compiled applications cannot use the File Open function."
It is clear that I'm barking up the wrong tree here, and I don't want to waste any more of anyone's time. Thanks for trying.
Jan
2019년 7월 11일
@Tom: Please do not post comments in the section for answers. Use the section for comments instead. Thanks.
"I would like to build an application to display .fig files" - this is possible and not hard to implement.
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!