User`s guide

Compiler Tips
m = magic(n);
Calling a Function from the Command Line
You can make a MATLAB function into a standalone that is directly callable
from the system command line. All the arguments passed to the MATLAB
function from the system command line are strings. Two techniques to work
with these functions are:
Modify the original MATLAB function to test each argument and convert
the strings to numbers.
Write a wrapper MATLAB function that does this test and then calls the
origin al MATLAB function.
For example:
function x=foo(a, b)
if (isstr(a)), a = str2num(a), end;
if (isstr(b)), b = str2num(b), end;
% The rest of your M-c ode her e...
Yo u only do this if your function expects numeric input. If your function
expects strings, there is nothing to do because that’s the default from the
command line.
Using MAT-Files in Deployed Applications
To use a MAT-file in a deployed application, use the MATLAB Compiler -a
option to include the file in the CTF archive. For m ore information on the -a
option, see “-a Add to Archive” on page 11-17.
Recommended Location of .CTF Files
The .CTF file must reside in the sam e directory as the executable or shared
library.
It is not recommended to use a relative path to start a deployed application
from a directory that is not your working directory. For example, if you
execute your application using
5-23