After the installation of MATLAB in Linux, will be generated under the/usr/local/bin/matlab file, you can use the MATLAB command.
Usage:matlab [-h|-help] | [-n |-e]
[-arch | v=variant | v=arch/variant]
[-C LicenseFile] [-display xdisplay |-nodisplay]
[-nosplash] [-mwvisual Visualid] [-debug] [-softwareopengl]
[-desktop |-nodesktop |-NOJVM]
[R Matlab_command] [-logfile log]
[-ddebugger [Options]]
-h|-help-display arguments.
-n-display Final environment variables,
arguments, and other diagnostic
Information. The MATLAB is not run.
-e-display all the environment variables and
Their values to standard output. Matlab
is not run. If The exit status is not
0 on return then the variables and values
May is correct.
-arch-start MATLAB assuming architecture arch.
V=variant-start the version of MATLAB found
In Bin/glnxa64/variant instead of Bin/glnxa64.
V=arch/variant-start the version of MATLAB found
In Bin/arch/variant instead of Bin/glnxa64.
-C Licensefile-set Location of the license file that MATLAB
should use. It can have the form port@host or
Be a colon separated list of license files.
The Lm_license_file and Mlm_license_file
Environment variables would be ignored.
-display xdisplay-send x commands to x server display, Xdisplay.
-nodisplay-do not display any X commands. The MATLAB
Desktop won't be started. However, unless
-NOJVM is also provided the Java virtual machine
would be started.
-nosplash-do not display the splash screen during startup.
-mwvisual visualid-the default X visual to use for figure windows.
-debug-provide debugging information especially for X
Based problems.
-desktop-allow the MATLAB desktop to is started by a
Process without a controlling terminal. This is
Usually a required command line argument
Attempting to start MATLAB from a window manager
menu or Desktop icon.
-nodesktop-do Not start the MATLAB desktop. Use the current
Terminal for commands. The Java virtual machine
would be started.
-singlecompthread-limit MATLAB to a single computational thread.
By default, MATLAB makes use of the multithreading
capabilities of the computer on which it is running.
-nojvm-shut off all Java support by not starting the
Java virtual machine. In particular the MATLAB
Desktop won't be started.
-JDB [Port]-Enable remote Java Debugging on port (default 4444)
-R Matlab_command-start MATLAB and execute the Matlab_command.
-logfile log-make A copy of any output to the command window
in file log. This is includes all crash reports.
-ddebugger [Options]-Start debugger to debug MATLAB.
-nouserjavapath-ignore custom Javaclasspath.txt and javalibrarypath.txt files.
Running MATLAB at the command line, mainly uses a few red parameters above.
1. Direct operation of Matlab
$ matlab
Then you can run the Matlab script directly
2. Run m file
If the M file name is MATLABFILE.M
(1) Method one
After entering the directory where m files reside, run
$ matlab-nodesktop-nosplash-rmatlabfile
Matlabfile only with filename, cannot add. m
(2) Modify the. bashrc file
$ vim ~/.BASHRC
Add the following:
# Add an ' Mrun ' alias for running Matlab in the terminal.
Alias mrun= "Matlab-nodesktop-nosplash-logfile ' Date +%y_%m_%d-%h_%m_%s '. Log-r"
After saving, enter the directory where the. m file is located and run
$ Mrun Matlabfile