我希望从我的 Windows 7 调度程序运行一个 matlab m 文件。
我可以使用下面的行运行不带参数的 matlab m 文件
-r my_matlab_function,exit
如果我有一个需要简单文本参数的 matlab 函数,是否还有办法通过 Windows 7 调度程序安排该函数运行?
最佳答案
你可以使用这个:
matlab -r "functionName input1 input2"
请注意,输入被解释为文本。这叫做 command syntax .例如,从 DOS 窗口发出此命令
matlab -r "find [2 3]"
产生
ans = 1 2 3 4 5
因为
[2 3]
被解释为五个char
的数组,所有这些都是非零的。您也可以使用 function syntax :
matlab -r "find([2 3])"
产生
ans = 1 2
正如预期的那样。
关于windows - 运行 matlab m 文件并从 Windows 7 调度程序提供参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31339143/