gpt4 book ai didi

windows - 运行 matlab m 文件并从 Windows 7 调度程序提供参数

转载 作者:可可西里 更新时间:2023-11-01 10:44:38 32 4
gpt4 key购买 nike

我希望从我的 Windows 7 调度程序运行一个 matlab m 文件。

我可以使用下面的行运行不带参数的 matlab m 文件

-r my_matlab_function,exit

如果我有一个需要简单文本参数的 matlab 函数,是否还有办法通过 Windows 7 调度程序安排该函数运行?

最佳答案

  1. 你可以使用这个:

    matlab -r "functionName input1 input2"

    请注意,输入被解释为文本。这叫做 command syntax .例如,从 DOS 窗口发出此命令

    matlab -r "find [2 3]"

    产生

    ans =
    1 2 3 4 5

    因为 [2 3] 被解释为五个 char 的数组,所有这些都是非零的。

  2. 您也可以使用 function syntax :

    matlab -r "find([2 3])"

    产生

    ans =
    1 2

    正如预期的那样。

关于windows - 运行 matlab m 文件并从 Windows 7 调度程序提供参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31339143/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com