【问题标题】:MATLAB - how to pass argument with command line and run the scriptMATLAB - 如何使用命令行传递参数并运行脚本
【发布时间】:2017-03-20 05:30:22
【问题描述】:

我有一个 matlab 脚本 dbEval.m:

function dbEval()

....function implementation
....
end


 dbEval();%call this function.

我用

在 shell 上运行这个脚本
matlab dbEval.m

现在,如果我想通过命令行执行传递参数。 我该怎么做?以及如何检索脚本中的参数并将其用作 dbEval 函数的参数?

【问题讨论】:

标签: matlab


【解决方案1】:

你可以这样做:

matlab -r 'dbEval(argument1, ... ,argumentN)';

matlab -r 'try dbEval(argument1, ... ,argumentN); catch; end; quit'

【讨论】:

    【解决方案2】:

    你也可以试试:

    matlab -r -nodesktop -nojvm 'dbEval(arg1 arg2 ...)'
    

    【讨论】:

      猜你喜欢
      • 2013-06-06
      • 2016-12-19
      • 2011-12-18
      • 2012-11-23
      • 1970-01-01
      • 2011-12-13
      • 1970-01-01
      • 1970-01-01
      • 2013-10-11
      相关资源
      最近更新 更多