If you're running Matlab scripts that iterate over simulation parameters (à la Tara), you might find it useful to be able to run everything from the command line (instead of launching the "Comsol with Matlab" GUI application).
First, the comsol command wasn't in my path, so I symlinked it to someplace where bash could find it:
ln -s /Applications/COMSOL43a/bin/comsol /opt/local/bin/comsol
I then started Comsol/Matlab using a slight modification of the commands given in the Comsol 4.3 help file "Running A COMSOL M-file In Batch Mode Without Display":
comsol server > server_log.txt &
matlab -nodesktop -nosplash -r "run /Applications/COMSOL43a/mli/mphstart; comsol_script; exit"
The first command starts the Comsol server in the background and cats its output into a log file. The second command launches Matlab, runs the initialization script which makes Matlab aware of Comsol, runs my Comsol/Matlab script (comsol_script.m), and then exits. |