Start MATLAB program (Windows platforms)
matlab -c licensefile
matlab -jdb portnumber
matlab -logfile filename
matlab -r "statement"
matlab -sd "startdir"
matlab is a script that runs the main MATLAB® executable on Microsoft® Windows® platforms. (In this document, the term matlab refers to the script, and MATLAB refers to the main executable). Before actually initiating the execution of MATLAB, it configures the run-time environment by:
Determining the MATLAB root folder.
Determining the host machine architecture.
Selectively processing command line options with the rest passed to MATLAB.
Setting certain MATLAB environment variables.
There are two ways in which you can control the way matlab works:
By specifying command line options.
By setting environment variables before calling the program.
Options that you can enter at the command line are as follows:
matlab helpOption displays information that matches the specified helpOption argument without starting MATLAB. helpOption can be any one of the keywords shown in the table below. Enter only one helpOption keyword in a matlab statement.
Values for helpOption
Display matlab command usage.
The same as -help.
The same as -help.
matlab -c licensefile starts MATLAB using the specified license file. The licensefile argument can have the form port@host. This option causes MATLAB to ignore the LM_LICENSE_FILE and MLM_LICENSE_FILE environment variables.
matlab -jdb portnumber starts MATLAB, enabling use of the Java® debugger. If you specify a port number, the Java debugger uses that port to communicate with MATLAB. You can specify any port number in the range 0-65535 that is not reserved or currently in use by another application on your system. By default, MATLAB uses port 4444. If you are running multiple MATLAB sessions and want to use the Java debugger, be sure to specify a port number.
matlab -nouserjavapath disables javaclasspath.txt and javalibrarypath.txt files.
matlab -r "statement" starts MATLAB and executes the specified MATLAB statement. If statement is the name of a MATLAB function or script, do not specify the file extension. Any required file must be on the MATLAB search path or in the startup folder.
matlab -sd "startdir" specifies the startup folder for MATLAB (the current folder in MATLAB after startup). The -sd option has been deprecated. For information about alternatives, see Startup Folder on Windows Platforms.
matlab shieldOption provides the specified level of protection of the address space used by MATLAB during startup on Windows 32–bit platforms. It attempts to help ensure the largest contiguous block of memory available after startup, which is useful for processing large data sets. The shieldOption does this by ensuring resources such as DLLs, are loaded into locations that will not fragment the address space. With shieldOption set to a value other than none, address space is protected up to or after the processing of matlabrc. Use higher levels of protection to secure larger initial blocks of contiguous memory, however a higher level might not always provide a larger size block and might cause startup problems. Therefore, start with a lower level of protection, and if successful, try the next higher level. You can use the memory function after startup to see the size of the largest contiguous block of memory; this helps you determine the actual effect of the shieldOption setting you used. If your matlabrc (or startup.m) requires significant memory, a higher level of protection for shieldOption might cause startup to fail; in that event try a lower level. Values for shieldOption can be any one of the keywords shown in the table below.
This is the default setting. It protects the range 0x50000000 to 0x70000000 during MATLAB startup until just before startup processes matlabrc. It ensures there is at least approximately 500 MB of contiguous memory up to this point.
Start with this, the default value. To use the default, do not specify a shield option upon startup.
If MATLAB fails to start successfully using the default option, -shield minimum, instead use -shield none.
If MATLAB starts successfully with the default value for shieldOption and you want to try to ensure an even larger contiguous block after startup, try using the -shield medium option.
This protects the same range as for minimum, 0x50000000 to 0x70000000, but protects the range until just after startup processes matlabrc. It ensures there is at least approximately 500 MB of contiguous memory up to this point.
If MATLAB fails to start successfully with the -shield medium option, instead use the default option (-shield minimum).
If MATLAB starts successfully with the -shield medium option and you want to try to ensure an even larger contiguous block after startup, try using the -shield maximum option.
This protects the maximum possible range, which can be up to approximately 1.5 GB, until just after startup processes matlabrc.
If MATLAB fails to start successfully with the -shield maximum option, instead use the -shield medium option.
This completely disables address shielding. Use this if MATLAB fails to start successfully with the default (-shield minimum) option.
matlab -wait MATLAB is started by a separate starter program which normally launches MATLAB and then immediately quits. Using this option tells the starter program not to quit until MATLAB has terminated. This option is useful when you need to process the results from MATLAB in a script. Calling MATLAB with this option blocks the script from continuing until the results are generated.
You can set the following environment variables before starting MATLAB.
This variable specifies the License File to use. If you use the -c argument to specify the License File it overrides this variable. The value of this variable can be a list of License Files, separated by semi-colons, or port@host entries.