Running an M-File in Batch Mode
Running COMSOL with MATLAB® in batch mode requires that you have xterm installed on your machine. If this is not the case, see Running an M-File in Batch Mode Without Display.
To run in batch an M-script that runs COMSOL Model is required. Start COMSOL with MATLAB at a terminal window with this command:
comsol mphserver matlab myscript
where myscript is the M-script, saved as myscript.m, that contains the operation to run at the MATLAB prompt.
You can also run the script in batch without the MATLAB desktop and the MATLAB splash screen. Enter this command:
comsol mphserver matlab myscript -nodesktop -mlnosplash