External Interfaces Reference |
Call function in external library
Syntax
Description
[x1, ..., xN] = calllib('libname', 'funcname', arg1, ..., argN)
calls the function funcname
in library libname
, passing input arguments arg1
through argN
. calllib
returns output values obtained from function funcname
in x1
through XN
.
If you used an alias when initially loading the library, then you must use that alias for the libname
argument.
Examples
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 unloadlibrary libmx
See Also
loadlibrary
, libfunctions
, libfunctionsview
, libpointer
, libstruct
, libisloaded
, unloadlibrary
Generic DLL Interface Functions | libfunctions |
© 1994-2005 The MathWorks, Inc.