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
Install Octave from here.
Add
octave-cli.exe
to the systemPATH
environment. In my case, the path isC:\Program Files\GNU Octave\Octave-6.4.0\mingw64\bin
.Create a simple script
vi hello.m
.
function hello
printf("Hello world!\n");
endfunction
- Make the script executable.
chmod +x hello.m
- Run the script.
octave-cli ./hello.m