matlab (Windows)
StartMATLABprogram fromWindowssystem prompt
Syntax
matlab
matlab option1 ... optionN
Description
matlab
starts the MATLAB®program from the Microsoft®Windows®system prompt. Here the termmatlab
refers to the command you type, and MATLAB refers to the program).
Thematlab
command:
Determines the MATLAB root folder, the value returned by the
matlabroot
function.Processes command-line options and passes other options to MATLAB.
matlab
starts MATLAB with the specified startup options.option1 ... optionN
Input Arguments
option1 ... optionN
—一个或多个启动选项
strings
一个或多个启动选项, specified as strings corresponding to valid startup options from the following tables.
Display Options
Option | Result |
---|---|
-noFigureWindows |
Disable the display of figure windows in MATLAB. |
-nosplash |
Do not display the splash screen during startup. |
Execute MATLAB Script or Function
Option | Result |
---|---|
|
Execute the MATLAB Example: Example: |
Set Initial Working Folder
The initial working folder is the current folder when MATLAB starts. For more information, seeMATLAB Startup Folder.
Option | Result |
---|---|
|
Set the MATLAB startup folder to Example: |
|
Set the MATLAB startup folder to the value specified by theInitial working folderoption in theGeneral Preferencespanel. |
Debugging Options
Option | Result |
---|---|
|
Copy Command Window output, including error log reports, in to Example: |
|
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 number. The |
Use Single Computational Thread
By default, MATLAB uses the multithreading capabilities of the computer on which it is running.
Option | Result |
---|---|
-singleCompThread |
Limit MATLAB to a single computational thread. |
Disable Searching Custom Java Class Path
Option | Result |
---|---|
-nouserjavapath |
Disable use of |
OpenGLLibrary Options
These options control the use of software OpenGL®libraries when MATLAB detects a graphics driver with known issues. For more information, seeGraphics Features with OpenGL Requirements.
Option | Result |
---|---|
-softwareopengl |
Force MATLAB to start with software OpenGL libraries. |
-nosoftwareopengl |
Disable auto-selection of OpenGL software. |
COM Automation Server Options
Option | Result |
---|---|
|
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 Automation server in the Windows registry. MATLAB displays a minimized command window; close this window. 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 Processor and selectRun as administrator. If that option is not available, contact your system administrator. MATLAB remains registered until you use the Alternatively, you can register MATLAB from the MATLAB command prompt. Type: !matlab -regserver |
|
Remove MATLAB COM server entries from the registry. |
Wait forMATLABto Terminate
By default, when you call thematlab
从脚本命令,命令开始MATLABnd then immediately executes the next statements in the script. The-wait
option pauses the script until MATLAB terminates.
Option | Result |
---|---|
|
Use in a startup script to process the results from MATLAB. Calling MATLAB with this option blocks the script from continuing until the results are generated. |
Specify License File
For more information, see Understanding License Files in theLicense Management(Installation, Licensing, and Activation) documentation.
Option | Result |
---|---|
|
Use the License File, Example: |
Open Student Version
Option | Result |
---|---|
|
Open student version of MATLAB. |
Help Options
Option | Result |
---|---|
-h |
Display startup options without starting MATLAB. |
-help |
Same as |
-? |
Same as |
Examples
Startup Without Splash Screen
matlab -nosplash
Copy Command Window Output into output.log File
matlab -logfile output.log
Tips
To add folders to the MATLAB search path at startup, set the
MATLABPATH
environment variable before running thematlab
command. For more information, seeAdd Folders to the MATLAB Search Path at Startup.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)