How to use the matlab compiler:

The Matlab compiler can be used to create a standalone program from Matlab code. The resulting executable runs faster and does not require a Matlab license. If you need to run multiple copies on Matlab on the beowulf, please use the compiler if you can to avoid exhausting our licenses!

Recommended use on the math network, including the beowulf:
1. make your top level M file a function with no arguments, e.g. main.m
2. from the shell (NOT in Matlab), say
   matlabcc -m main.m
   to compile with debugging, add the flag -g
   to compile with graphics, add the flag -B sgl
   to compile with optimization, add the flag -O all
3. run the resulting executable main
Notes:
1. Please do NOT run the compiler directly in your Matlab session as it ties up the compiler license, and we have only one
2. The following things cause a warning in compilation and may cause a runtime error if the offending statement is executed: objects, most toolboxes, inline, whos, some graphics functions that are passed functions by string
3. Program compiled with graphics will not run without X windows. This includes running on beowulf nodes from PBS scripts.
4. Program containing graphics commands and compiled without graphics will produce compile time warning but will run fine as long as the graphics commands are not executed.
5. The following commands work differently: eval, feval, exist, global.
6. Use handles to pass functions rather than strings.
7. Do not use exist to check for the presence of arguments in a function.

For more details and other ways to use the compiler, see Matlab help. In case of difficulties, refer to the section
MATLAB Compiler >
	Introducing the MATLAB Compiler >
		Limitations and Restrictions