External Interfaces Previous page   Next Page

The Distinction Between mx and mex Prefixes

Routines in the API that are prefixed with mx allow you to create, access, manipulate, and destroy mxArrays. Routines prefixed with mex perform operations back in the MATLAB environment.

mx Routines

The array access and creation library provides a set of array access and creation routines for manipulating MATLAB arrays. These subroutines, which are fully documented in the online API reference pages, always start with the prefix mx. For example, mxGetPi retrieves the pointer to the imaginary data inside the array.

Although most of the routines in the array access and creation library let you manipulate the MATLAB array, there are two exceptions -- the IEEE routines and memory management routines. For example, mxGetNaN returns a double, not an mxArray.

mex Routines

Routines that begin with the mex prefix perform operations back in the MATLAB environment. For example, the mexEvalString routine evaluates a string in the MATLAB workspace.


Previous page  MEX-File Placement MATLAB Data Next page

© 1994-2005 The MathWorks, Inc.