← 返回命令列表

Linux command

octave 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start an interactive session

octave

Start an interactive CLI session

octave --no-gui

Run a script file

octave [path/to/script.m]

Evaluate an expression and exit

octave --eval "[diag([1,2,3])]"

Run a script quietly

octave --quiet [path/to/script.m]

Run in batch mode

octave --no-gui --silent [path/to/script.m]

说明

GNU Octave is a high-level interpreted language primarily intended for numerical computations. It provides a convenient command-line interface and GUI for solving linear and nonlinear problems numerically, and is largely compatible with MATLAB. Octave features extensive tools for matrix operations, solving systems of equations, numerical integration, statistics, optimization, and 2D/3D plotting. It can be extended with packages from Octave Forge and supports calling C, C++, and Fortran code.

参数

--eval _CODE_
Evaluate CODE and exit (unless --persist is also given).
--gui
Start the graphical user interface.
--no-gui
Use the command-line interface instead of the GUI.
-q, --quiet, --silent
Suppress the startup message and version info.
-i, --interactive
Force interactive mode (useful when running via pipes or remote shells).
--no-init-file
Don't read the ~/.octaverc or .octaverc initialization files.
--persist
Stay interactive after --eval or running a script file.
--path _dir_
Add directory to the head of the function search path.
--jit-compiler
Enable the JIT compiler for accelerating loops.
--help
Display help information.
--version
Display version information.

FAQ

What is the octave command used for?

GNU Octave is a high-level interpreted language primarily intended for numerical computations. It provides a convenient command-line interface and GUI for solving linear and nonlinear problems numerically, and is largely compatible with MATLAB. Octave features extensive tools for matrix operations, solving systems of equations, numerical integration, statistics, optimization, and 2D/3D plotting. It can be extended with packages from Octave Forge and supports calling C, C++, and Fortran code.

How do I run a basic octave example?

Run `octave` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --eval _CODE_ do in octave?

Evaluate CODE and exit (unless --persist is also given).