| Passing Arguments In this section... "Displaying MATLAB® Syntax for Library Functions" on page 2-10 "General Rules for Passing Arguments" on page 2-11 "Passing References" on page 2-12 "Passing a NULL Pointer" on page 2-13 "Using C++ Libraries" on page 2-13 Displaying MATLAB® Syntax for Library Functions The MATLAB® software includes a sample external library called shrlibsample. The library file for the shrlibsample library is in the directory extern\examples\shrlib. MATLAB selects the appropriate version for your platform. The mexext function returns the file extension that is used on your platform. To use the shrlibsample library, you first need to either add this directory to your MATLAB path with the command: addpath([matlabroot '\extern\examples\shrlib']) or make this your current working directory with the command: cd ([matlabroot ' \extern\examples\shrlib ']) The following example loads the shrlibsample library and displays the MATLAB syntax for calling functions in the library: loadlibrary shrlibsample shrlibsample.h libfunctions shrlibsample -full MATLAB displays: Functions in library shrlibsample: [double, doublePtr] addDoubleRef(double, doublePtr, double) double addMixedTypes(int16, int32, double) |