How do I execute .m files in Octave?

有帮助吗?

解决方案

In the Octave prompt, simply type file1.

Of course, you need to make sure Octave can recognize its path.

其他提示

In octave prompt, type run("file1.m") or entering the filename without .m extension.

There are two ways to execute a file in Octave ::

  1. Simply type the filename without extension .

  2. Type run("filename.m") in the command line of Octave .

    Then press ctrl + c to exit the file in middle of the run .

Example ::

File name here is  'ex1' which is being executed

To run your Octave file in GNU Octave.

  1. navigate to editor tab at the bottom of command editor
  2. Press Ctrl+O or Go to file and open your file
  3. Pres F5 or Navigate to Run and Save and Run

You can see the logs in command window

Be sure to check that your file name is same as the function name.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top