Error in creating executable file for MATLAB code
Mostra commenti meno recenti
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!
Risposte (1)
Walter Roberson
il 6 Mar 2017
0 voti
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 Commenti
Walter Roberson
il 6 Mar 2017
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
il 6 Mar 2017
GG
il 6 Mar 2017
Walter Roberson
il 6 Mar 2017
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
il 6 Mar 2017
Walter Roberson
il 6 Mar 2017
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
il 6 Mar 2017
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!