Start MATLAB program from Windows system prompt
matlab starts the MATLAB® program from the Microsoft®
Windows® system prompt. In this topic the term
refers to the command you type, and MATLAB refers to the program.
Determines the MATLAB root folder, the value
returned by the
Processes command-line options and passes other options to MATLAB.
To capture the exit code, start MATLAB with the
matlab starts MATLAB with the specified startup options.
option1 ... optionN
option1 ... optionN— One or more startup options
One or more startup options, specified as strings corresponding to valid startup options from the following tables.
Disable the display of figure windows in MATLAB.
Do not display the splash screen during startup.
The initial working folder is the current folder when MATLAB starts. For more information, see MATLAB Startup Folder.
Set the MATLAB folder to
Set the MATLAB folder to the value specified by the Initial working folder preference, located in the General Preferences page of the Preferences Window.
Copy Command Window output, including error log
reports, in to
Enable use of the Java® debugger. The Java debugger uses the default
The port number is
optional. However, to use the Java debugger while running multiple
MATLAB sessions, you must provide a port
Execute MATLAB script, statement, or function non-interactively. MATLAB:
if a session of MATLAB is running in batch mode, call the
Execute the MATLAB
To set the initial working folder, use the
By default, MATLAB uses the multithreading capabilities of the computer on which it is running.
Limit MATLAB to a single computational thread. This option is for numerical computations only.
Disable use of
These options control the use of software OpenGL® libraries when MATLAB detects a graphics driver with known issues. For more information, see Graphics Features That Have Specific Requirements.
Force MATLAB to start with software OpenGL libraries.
Disable auto-selection of OpenGL software.
Start MATLAB as a Component Object Model (COM) Automation server. MATLAB does not display the splash screen and minimizes the window. Use for a single call to MATLAB.
Register MATLAB as a COM server in the Windows registry.
You must have administrator privileges to change the Windows registry. Based on your User Account Control (UAC) settings, you might need to right-click a Windows Command Prompt and select Run as administrator. If that option is not available, contact your system administrator.
Alternatively, you can register MATLAB from the MATLAB command prompt. Type:
Remove MATLAB COM server entries from the registry.
By default, when you call the
matlab command from a
script, the command starts MATLAB and then immediately executes the next statements in the
-wait option pauses the script until
Use in a script to process the results from MATLAB. Calling MATLAB with this option blocks the script from continuing until the results are generated.
For more information, see Update or Modify Network License Files.
Use the License File,
Display options without starting MATLAB.
matlab -logfile output.log
To return an exit status on the command line, start
MATLAB with the
From the operating system prompt, type:
To add folders to the MATLAB search path at startup, set the
environment variable before running the
matlab command. For
more information, see Add Folders to the MATLAB Search Path at Startup.
-roption for non-interactive use is not recommended
Not recommended starting in R2019a
To start MATLAB non-interactively, use the
-batch option. To start
MATLAB interactively, use the