Question

How do I execute .m files in Octave?

Was it helpful?

Solution

In the Octave prompt, simply type file1.

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top