User`s guide

C Shared Library Target
matlabroot/extern/examples/compiler/multiplymatrix. m
matlabroot/extern/examples/compiler/eigmatrix.m
matlabroot/extern/examples/compiler/matrixdriver.c
Note matrixdriver.c contains the standalone application’s ma in function.
2 To create the shared library, enter the following command on a single line:
mcc -B csharedlib:libmatrix addmatrix.m multiplymatrix.m
eigmatrix.m -v
The -B csharedlib option is a bundle option that expands into
-W lib:<libname> -T link:lib
The -W lib:<libname> option tells MATLAB Compiler to generate a
function wrapper for a shared library and call it
libname.The-T link:lib
option specifies the target output as a shared library. Note the directory
where M ATLAB Compiler puts the shared library b ecause you will need it
later on.
Writing the Driver Application
All programs that call MATLAB Compiler generated shared libraries have
roughly the same structure:
1 Declare variables and process/validate input arguments.
2 Call mcl Init ializeApplication, and test for success. This function sets
up the global M CR state and enables the construction of MCR instances.
3 Call, once for each library, <libraryn ame> Initialize, to create the M CR
instance required by the library.
4 Invoke functions in the library, and process the results. (This is the main
body of the program.)
7-5