Stealing pages from the server...

Run Octave Script from Command Line


Introduction

Octave is an open-source replacement for MATLAB, a software and programming environment for numerical arithmetic and data analysis. Sometimes it’s more convenient to run Octave scripts from the command line.

Steps

  1. Install Octave from here.

  2. Add octave-cli.exe to the system PATH environment. In my case, the path is C:\Program Files\GNU Octave\Octave-6.4.0\mingw64\bin.

  3. Create a simple script vi hello.m.

function hello
	printf("Hello world!\n");
endfunction
  1. Make the script executable.
chmod +x hello.m
  1. Run the script.
octave-cli ./hello.m

References

  1. https://www.xmodulo.com/how-to-run-octave-script-from-command-line.html

Author: Yang Wang
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Yang Wang !
 Previous
Equivalent WATCH Command in Windows Equivalent WATCH Command in Windows
In Linux, the watch command is extremely handy for running a command on a regular basis and displaying the results. This is particularly useful if you need to keep track of any changes in the output of a command that is run repeatedly. The watch command has no direct equivalent in Windows, however the while loop in Windows PowerShell or the for loops in a Windows command-line prompt (CMD) can achieve the same result.
2022-03-23
Next 
Use SUBL Command in Windows Use SUBL Command in Windows
It's sometimes easier to edit a file from terminal by using Sublime Text, and yet it is not the default in Windows. This tutorial will show you how to use the command line to open files with Sublime Text in Windows.
2021-12-20
  TOC