Starting COMSOL® with MATLAB® on Windows ®/ Mac OSX / Linux®
To run a COMSOL Multiphysics model at the MATLAB® prompt, start COMSOL with MATLAB:
On Windows® use the COMSOL Multiphysics with MATLAB shortcut icon that is created on the desktop after the automatic installation. A link is also available in the Windows start menu under COMSOL Multiphysics 5.6>COMSOL Multiphysics 5.6 with MATLAB.
On Mac OS X, use the COMSOL Multiphysics 5.6 with MATLAB application available in the Application folder.
On Linux®, enter the command comsol mphserver matlab at a terminal window.
See the COMSOL Multiphysics Installation Guide for a complete description about how to start COMSOL with MATLAB on these supported platforms.
The first time COMSOL Multiphysics with MATLAB is started, login and password information is requested to establish the client/server connection. The information is saved in the user preference file and is not required again.
 
Launching COMSOL Multiphysics with MATLAB enables LiveLink™ for Simulink® as long as it is installed on the machine.
 
To reset the login information, add the flag -login force to the icon target path.
To reset the login information, enter the command comsol mphserver matlab -login force at a system command prompt.
Running a Model M-file from terminal prompt
If you want to run an M-file directly at a terminal prompt immediately after having started COMSOL Multiphysics with MATLAB enter the startup command as described below:
where filename.m is the file containing both MATLAB and COMSOL API command to be executed using COMSOL with MATLAB.
Running without Display
If you need to run COMSOL with MATLAB on a machine without support for graphics display, add the flags nodesktop and mlnosplash to the startup command as described below:
The above command starts MATLAB without splash screen and without the MATLAB desktop.
To avoid the splash screen on the COMSOL server you need to create the environment variable COMSOL_MATLAB_INIT and set it to matlab -nosplash.