External Interfaces |
Invoking Library Functions
Once a shared library has been loaded into MATLAB, use the calllib
function to call any of the functions from that library. Specify the library name, function name, and any arguments that get passed to the function:
This example calls functions from the libmx
library to test the value stored in y
.
hfile = [matlabroot '\extern\include\matrix.h']; loadlibrary('libmx', hfile) y = rand(4, 7, 2); calllib('libmx', 'mxGetNumberOfElements', y) ans = 56 calllib('libmx', 'mxGetClassID', y) ans = mxDOUBLE_CLASS
Getting Information About the Library | Passing Arguments |
© 1994-2005 The MathWorks, Inc.