【问题标题】:MATLAB::This functionality is no longer supported under the -nojvm startup optionMATLAB:: -nojvm 启动选项下不再支持此功能
【发布时间】:2017-01-24 00:33:45
【问题描述】:

我在终端中运行 Matlab 代码,因为稍后我需要在 php 中调用它。但是我得到了这些错误:

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

错误:

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;

你能指导我如何解决这个问题,或者我还能如何从 PhP 运行 Matlab 代码?目前我可以从php运行ls -ltr之类的命令并在网页上查看结果!

【问题讨论】:

    标签: php matlab shell ubuntu terminal


    【解决方案1】:

    根据您收到的错误消息,不再支持使用-nojvm 处理图形。你应该改用-nodesktop

    在您的环境中,应该是:

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

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

    以下是受影响功能的摘要:

    • 创建图形和执行绘图任务,例如使用绘图、轴、getframe 和 gcf 函数。
    • 打印图形并使用相关功能,例如 print、hgexport 和 saveas。
    • 使用 GUI 构建函数(例如 warndlg)在 MATLAB 中创建 GUI。 使用 Simulink 示波器并打印 Simulink 模型。

    【讨论】:

    • -nojvm 仍受支持。使用不支持的-nojvm 时只是graphics。我在下面的回答对此进行了详细说明。
    【解决方案2】:

    您已禁用最新版本的 MATLAB 中图形所需的 JVM。如果您需要图形但不需要 IDE,可以使用-nodesktop -nosplash 启动 MATLAB。 -nosplash 选项确保不显示 MATLAB 启动屏幕。

    matlab -nodesktop -nosplash
    

    【讨论】:

    • 虽然这不会产生错误,但它也没有显示任何数字。当我使用像shell_exec('ls -lart')这样的php shell exec运行这个命令时,如何让它显示数字?
    • @MonaJalal 我以为您不想显示这些数字。我已经修改了(如果你仍然看不到数字,你需要用set(0, 'defaultfigurevisible', 'on')重置数字可见性@
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-23
    • 1970-01-01
    相关资源
    最近更新 更多