User`s manual
1
Calling C and Fortran
Programs from MATLAB
Introducing MEX-Files . . . . . . . . . . . . . . . 1-3
Using MEX-Files . . . . . . . . . . . . . . . . . . . 1-3
The Distinction Between mx and mex Prefixes . . . . . . . 1-4
MATLAB Data . . . . . . . . . . . . . . . . . . . 1-6
The MATLAB Array . . . . . . . . . . . . . . . . . 1-6
Data Storage . . . . . . . . . . . . . . . . . . . . 1-6
Data Types in MATLAB . . . . . . . . . . . . . . . . 1-7
Using Data Types . . . . . . . . . . . . . . . . . . 1-9
Building MEX-Files . . . . . . . . . . . . . . . . . 1-11
Compiler Requirements . . . . . . . . . . . . . . . . 1-11
Testing Your Configuration on UNIX . . . . . . . . . . 1-12
Testing Your Configuration on Windows . . . . . . . . . 1-14
Specifying an Options File . . . . . . . . . . . . . . . 1-17
Custom Building MEX-Files . . . . . . . . . . . . . 1-20
Who Should Read This Chapter . . . . . . . . . . . . . 1-20
MEX Script Switches . . . . . . . . . . . . . . . . . 1-20
Default Options File on UNIX . . . . . . . . . . . . . 1-22
Default Options File on Windows . . . . . . . . . . . . 1-23
Custom Building on UNIX . . . . . . . . . . . . . . . 1-24
Custom Building on Windows . . . . . . . . . . . . . 1-26
Troubleshooting . . . . . . . . . . . . . . . . . . 1-32
Configuration Issues . . . . . . . . . . . . . . . . . 1-32
Understanding MEX-File Problems . . . . . . . . . . . 1-33
Compiler and Platform-Specific Issues . . . . . . . . . . 1-37
Memory Management Compatibility Issues . . . . . . . . 1-37
Additional Information . . . . . . . . . . . . . . . 1-42
Files and Directories - UNIX Systems . . . . . . . . . . 1-42
Files and Directories - Windows Systems . . . . . . . . . 1-44
Examples . . . . . . . . . . . . . . . . . . . . . . 1-46
Technical Support . . . . . . . . . . . . . . . . . . 1-48