Use Matrix Library and the MEX Library functions in gateway and computational routines to interact with data in the MATLAB® workspace. These libraries are part of the MATLAB C/C++ and Fortran API Reference library.
To use these functions, include the
mex header, which declares the
entry point and interface routines. Put this statement in your source file:
Use Matrix Library functions to pass
mxArray, the type MATLAB uses to store arrays, to and from MEX files. For examples using these
Use MEX Library functions to perform operations in the MATLAB environment. For examples using these functions, see
Unlike MATLAB functions, MEX file functions do not have their own variable
workspace. MEX file functions operate in the caller workspace. Use
mexEvalString to evaluate the command in the caller
workspace. Use the
mexPutVariable functions to get and put variables into the
The Matrix and MEX libraries use the MATLAB
mwIndex for cross-platform
mwSize represents size values, such as array
dimensions and number of elements.
mwIndex represents index
values, such as indices into arrays.