Error in creating executable file for MATLAB code
이전 댓글 표시
Hi, I made a script that automates some data analysis. I used the MATLAB compiler and made the project. However, when opening the .exe file, an error pops up saying "the functionality is no longer supported under the -nojvm startup".
Is there any other way I can make a project for my MATLAB script? Any suggestions are appreciated..
Thank you!
답변 (1개)
Walter Roberson
2017년 3월 6일
0 개 추천
Does it give a hint about what functionality it is referring to?
... Are you using ginput?
See https://www.mathworks.com/help/matlab/release-notes.html?rntext=&startrelease=R2013a&endrelease=R2013a&category=Graphics&groupby=release&sortby=descending&searchHighlight= R2013a Release notes in Graphics section about Functionality being Changed or Removed.
Are you compiling as a "Console" application? I would not expect ginput to work as a console application.
댓글 수: 10
Walter Roberson
2017년 3월 6일
Are you compiling as a Console (command line) application? If so then I am not sure you can do graphics in that, including not uigetfile(). I suspect you would need to compile as a "Standalone" application.
Caution: remember that compiled applications terminate as soon as they reach the last instruction in the function. If you had some structure like,
[filename, pathname] = uigetfile(....)
data = csvread( fullfile(pathname, filename) );
bar(data)
then (even with a Standalone application) those lines would run but right after it created the plot it would say "Okay, I'm done for the day" and exit the process. If you are creating graphics you need to use a method to ensure that you do not end the program until the user asks to end. uiwait() and waitfor() are good ways to do that. If you happen to use GUIDE then in the main routine it creates there is a commented out uiwait(); if you remove the comment mark then the GUI will not exit until the user closes the figure.
GG
2017년 3월 6일
GG
2017년 3월 6일
Walter Roberson
2017년 3월 6일
If you are not using GUIDE, then figure() explicitly, and waitfor() the figure to prevent exiting early.
With a standalone application chosen and the few things you have mentioned using, I cannot think of any reason you might receive that message about functionality no longer supported.
Which release are you using?
GG
2017년 3월 6일
Walter Roberson
2017년 3월 6일
I don't see anything odd looking in that, other than it being uncommon to waitfor() a plot instead of a figure or uicontrol.
Side note: in the code you show, the hold on and hold off are not needed: the calls you do in-between will not trigger a new plot. But the hold calls should not hurt at all, other than a tiny efficiency loss.
GG
2017년 3월 6일
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!