External Interfaces - The MathWorks - #50

/ 649


catalogue search
P. 01
P. 02
P. 03
P. 04
P. 05
P. 06
P. 07
P. 08
P. 09
P. 10
P. 11
P. 12
P. 13
P. 14
P. 15
P. 16
P. 17
P. 18
P. 19
P. 20
P. 21
P. 22
P. 23
P. 24
P. 25
P. 26
P. 27
P. 28
P. 29
P. 30
P. 31
P. 32
P. 33
P. 34
P. 35
P. 36
P. 37
P. 38
P. 39
P. 40
P. 41
P. 42
P. 43
P. 44
P. 45
P. 46
P. 47
P. 48
P. 49
P. 50


See other catalogues for The MathWorks

Text version of the page
2 MATLAB® Interface to Generic DLLs_
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)
2-10

pageCatalog pdf di En 2012-06-22-01