User`s guide

UNIX Workstation
2-11
OnUNIX,MEX-fi lesarecreatedwithplatform-specifi cextensions,asshownin
this table .
The
<matlab>/extern/examples/mex directory contains C source code for the
example
yprime.c. After youcopy the sourcefile (yprime.c) to a local directory
and
cd to that directory, enter at the MATLAB prompt
mex yprime.c
This should create the MEX-file called yprime with the appropriate extension
corresponding to your UNIX pla tform. For example, if you create the MEX-file
on Solaris, its name is
yprime.mexsol.
Youcan nowcall
yprime from the MATLAB promptasifitwere an M-function.
For example,
yprime(1,1:4)
ans =
2.0000 8.9685 4.0000 -1.0947
If you encounter problems generating the MEX-file or g etting the correct
results, refer to “External Interfaces/API” for additi onal information ab out
MEX-files.
Table 2-2: MEX-File Extensions for UNIX
Platform MEX-File Extension
DEC Alpha
mexaxp
HP 9000 PA-RISC
mexhp7
HP-UX
mexhpux
IBM RS/6000
mexrs6
Linux
mexglx
SGI
mexsg
Solaris
mexsol