Mona Jalal Mona Jalal - 2 months ago 21
Bash Question

MATLAB::This functionality is no longer supported under the -nojvm startup option

I am running a Matlab code in terminal because later on I would need to call this in php. However I get these errors:

jalal@klein:~/Desktop/v1.2$ matlab -nojvm < matlab.m


Errors:

L2 norm on unsampled vertices: 0.096158
>> >> >> >> >> >> Error using figure
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

>> Error using gcf
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in newplot (line 63)
fig = gcf;

Error in scatter>localGetAxesInfo (line 102)
cax = newplot(cax);

Error in scatter (line 82)
[~,parax] = localGetAxesInfo(cax);

>> >> >> >> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in title (line 22)
ax = gca;

>> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in hold (line 34)
ax = gca;

>> >> >> Error using figure
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

>> Error using gcf
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in newplot (line 63)
fig = gcf;

Error in scatter>localGetAxesInfo (line 102)
cax = newplot(cax);

Error in scatter (line 82)
[~,parax] = localGetAxesInfo(cax);

>> >> >> >> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in title (line 22)
ax = gca;

>> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in hold (line 34)
ax = gca;

>> >> Error using figure
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

>> Error using gcf
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in newplot (line 63)
fig = gcf;

Error in scatter>localGetAxesInfo (line 102)
cax = newplot(cax);

Error in scatter (line 82)
[~,parax] = localGetAxesInfo(cax);

>> >> >> >> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in title (line 22)
ax = gca;

>> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in hold (line 34)
ax = gca;

>> >> Error using figure
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

>> Error using gcf
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in newplot (line 63)
fig = gcf;

Error in scatter>localGetAxesInfo (line 102)
cax = newplot(cax);

Error in scatter (line 82)
[~,parax] = localGetAxesInfo(cax);

>> >> >> >> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in title (line 22)
ax = gca;

>> Error using gca
This functionality is no longer supported under the -nojvm startup option. For
more information, see "Changes to -nojvm Startup Option" in the MATLAB Release
Notes. To view the release note in your system browser, run
web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6',
'-browser').

Error in hold (line 34)
ax = gca;


Can you please guide me how to fix this or how else can I run a Matlab code from PhP? currently I am able to run commands like
ls -ltr
from php and see the result on webpage!

Answer

According to the error message you received, Handle Graphics using -nojvm is no longer supported. You should be using -nodesktop instead.

In your environment, it should be:

jalal@klein:~/Desktop/v1.2$ matlab -nodesktop < matlab.m

http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6

Here is a summary of the affected features:

  • Creating figures and performing plotting tasks, such as using the plot, axes, getframe, and gcf functions.
  • Printing figures and using related functions such as print, hgexport, and saveas.
  • Creating GUIs in MATLAB using GUI-building functions such as warndlg. Using Simulink scopes and printing Simulink models.
Comments