从终端使用Octave运行功能

时间:2012-04-05 17:49:42

标签: terminal octave

我想在test.m文件中运行一个函数 - 比方说test。我想从终端使用Octave运行此功能。所以,它应该是这样的:

$>/Users/me/octave/bin/octave test(param1,param2)?

我怎样才能做到这一点?我可以在Matlab中做到这一点。但我没有找到Octave的方法。

2 个答案:

答案 0 :(得分:4)

您可以使用octave --eval CODE

答案 1 :(得分:1)

Octave的相关文档可以找到here。使用输入参数运行函数:

  1. 在终端<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <table id="table"> <thead> <tr> <th value='2'> Completed </th> <th value='4'> Cancelled </th> <th value='5'> Pending </th> <th value='1'> Arrived </th> <th value='9'> Waiting </th> <th value='10'> Cancelled Provider</th> </tr> </thead> <tbody> <tr> <td value='2017-20-8'>2017-20-8</td> </tr> <tr> <td value='2017-20-9'>2017-20-9</td> </tr> </tbody> </table>到您的工作目录。
  2. 键入cd以打开交互式会话。
  3. octave检查您的功能文件是否在您的工作目录中,如果没有,则ls到目录。
  4. 键入函数的名称,然后按正确的顺序输入括号中的输入参数,例如:cd。然后,您的函数将运行,吐出您打印的内容以及不以>foo(100)结尾的代码行的所有结果。
相关问题