LinuxCommandLibrary

matlab

TLDR

Start MATLAB

$ matlab
copy
Start without GUI (command line)
$ matlab -nodesktop
copy
Run script and exit
$ matlab -batch "[script_name]"
copy
Run with specific startup file
$ matlab -r "[startup_commands]"
copy
Start without splash screen
$ matlab -nosplash
copy
Run script with arguments
$ matlab -batch "[myscript('[arg1]', '[arg2]')]"
copy
Start with reduced memory
$ matlab -nojvm
copy
Show version
$ matlab -help
copy

SYNOPSIS

matlab [-nodesktop] [-batch command] [-r command] [-nosplash] [options]

DESCRIPTION

matlab launches MATLAB, a computing environment for numerical computation, visualization, and programming. It's widely used in engineering, science, and finance.
The desktop provides an integrated environment with editor, command window, workspace, and figure windows. No-desktop mode offers command-line interaction for scripts and automation.
Batch mode (-batch) executes commands and exits, suitable for automated workflows and scheduled jobs. It returns non-zero exit codes on errors, unlike -r which continues on errors.
Scripts (.m files) contain MATLAB code. Functions define reusable operations. The MATLAB path determines which files are accessible.
Without JVM (-nojvm), MATLAB uses less memory but loses desktop, figure windows, and some toolbox features. Useful for computation-only tasks on resource-limited systems.

PARAMETERS

-nodesktop

Start without desktop GUI.
-nodisplay
Start without display (no figures).
-nosplash
Skip splash screen.
-nojvm
Start without Java (limited features).
-batch COMMAND
Run command/script and exit.
-r COMMAND
Run command on startup.
-logfile FILE
Copy output to log file.
-sd DIR
Set startup directory.
-useStartupFolderPref
Use preference for startup folder.
-singleCompThread
Limit to single thread.
-help
Show help and version.

CAVEATS

Commercial license required. Large memory footprint. Startup time can be significant. Some toolboxes require additional licenses. Not all features work in nodesktop mode.

HISTORY

MATLAB was created by Cleve Moler in the late 1970s to provide students access to LINPACK and EISPACK without Fortran. MathWorks was founded in 1984 to commercialize it. MATLAB became the standard for numerical computing in academia and industry.

SEE ALSO

octave(1), python(1), julia(1), r(1)

Copied to clipboard