User`s manual

Advanced Topics
2-45
mex myCmexFile.c <matlab>/extern/lib/win32/microsoft/msvc60/
libmwlapack.lib
For IBM_RS, use the following syntax.
mex myCmexFile.c -L<matlab>/bin/ibm_rs -lmwlapack
On all other platforms, you can build your MEX-file as you would any other C
MEX-file. For example,
mex myCmexFile.c
MEX-Files That Perform Complex Number Conversion.
MATLAB supplies the files
fort.c and fort.h, which provide routines for conversion between MATLAB
and FORTRAN complex data structures. These files define the
mat2fort and
fort2mat routines mentioned previously under “Handling Complex Numbers”
on page 2-42.
If your program uses these routines, then you need to:
1 Include the fort.h file in your program, using, #include "fort.h". See the
example above.
2 Build the fort.c file with your program. Specify the pathname, <matlab>/
extern/examples/refbook
for both fort.c and fort.h in the build
command, (where
<matlab> stands for the MATLAB root directory).
On the PC, use either one of the following.
mex myCmexFile.c <matlab>/extern/examples/refbook/fort.c
-I<matlab>/extern/examples/refbook <matlab>/extern/lib/win32/
digital/df60/libmwlapack.lib
mex myCmexFile.c <matlab>/extern/examples/refbook/fort.c
-I<matlab>/extern/examples/refbook <matlab>/extern/lib/win32/
microsoft/msvc60/libmwlapack.lib
For IBM_RS, use
mex myCmexFile.c <matlab>/extern/examples/refbook/fort.c
-I<matlab>/extern/examples/refbook -L<matlab>/bin/ibm_rs
-lmwlapack
For all other platforms, use