Using the C++ Math Library    

Array Access Functions

The Array Access and Creation Library contains the array creation and access routines for the mxArray data type. In general, the arguments to these functions are mxArray* pointers instead of mwArray variables. For example, mxCreateDoubleMatrix() creates an mxArray; mxDestroyArray() destroys one.

Refer to the online MATLAB Application Program Interface Reference for a detailed definition of each function. The MATLAB Application Program Interface Guide also documents these functions.

Array Access Routines 
Function
Purpose
mxCalloc, mxFree
Allocate and free dynamic memory using MATLAB's memory manager.
mxClearLogical
Clear the logical flag.
mxCreateCellArray
Create an unpopulated N-dimensional cell mxArray.
mxCreateCellMatrix
Create an unpopulated 2-D cell mxArray.
mxCreateCharArray
Create an unpopulated N-dimensional string mxArray.
mxCreateCharMatrixFromStrings
Create a populated 2-D string mxArray.
mxCreateDoubleMatrix
Create an unpopulated 2-D, double-precision, floating-point mxArray.
mxCreateNumericArray
Create an unpopulated N-dimensional numeric mxArray.
mxCreateSparse
Create a 2-D unpopulated sparse mxArray.
mxCreateString
Create a 1-by-n string mxArray initialized to the specified string.
mxCreateStructArray
Create an unpopulated N-dimensional structure mxArray.
mxCreateStructMatrix
Create an unpopulated 2-D structure mxArray.
mxDestroyArray
Free dynamic memory allocated by an mxCreate routine.
mxDuplicateArray
Make a deep copy of an array.
mxGetCell
Get a cell's contents.
mxGetClassID
Get (as an enumerated constant) an mxArray's class.
mxGetClassName
Get (as a string) an mxArray's class.
mxGetData
Get pointer to data.
mxGetDimensions
Get a pointer to the dimensions array.
mxGetElementSize
Get the number of bytes required to store each data element.
mxGetEps
Get value of eps.
mxGetField
Get a field value, given a field name and an index in a structure array.
mxGetFieldByNumber
Get a field value, given a field number and an index in a structure array.
mxGetFieldNameByNumber
Get a field name, given a field number in a structure array.
mxGetFieldNumber
Get a field number, given a field name in a structure array.
mxGetImagData
Get pointer to imaginary data of an mxArray.
mxGetInf
Get the value of infinity.
mxGetIr
Get the ir array of a sparse matrix.
mxGetJc
Get the jc array of a sparse matrix.
mxGetM, mxGetN
Get the number of rows (M) and columns (N) of an array.
mxGetName, mxSetName
Get and set the name of an mxArray.
mxGetNaN
Get the value of Not-a-Number.
mxGetNumberOfDimensions
Get the number of dimensions.
mxGetNumberOfElements
Get number of elements in an array.
mxGetNumberOfFields
Get the number of fields in a structure mxArray.
mxGetNzmax
Get the number of elements in the ir, pr, and (if it exists) pi arrays.
mxGetPi, mxGetPr
Get the real and imaginary parts of an mxArray.
mxGetScalar
Get the real component from the first data element of an mxArray.
mxGetString
Copy the data from a string mxArray into a C-style string.
mxIsChar
True for a character array.
mxIsClass
True if mxArray is a member of the specified class.
mxIsComplex
True if data is complex.
mxIsDouble
True if mxArray represents its data as double-precision, floating-point numbers.
mxIsEmpty
True if mxArray is empty.
mxIsFinite
True if value is finite.
mxIsInf
True if value is infinite.
mxIsLogical
True if mxArray is Boolean.
mxIsNaN
True if value is Not-a-Number.
mxIsNumeric
True if mxArray is numeric or a string.
mxIsSingle
True if mxArray represents its data as single-precision, floating-point numbers.
mxIsSparse
Inquire if an mxArray is sparse. Always false for the MATLAB C Math Library.
mxIsStruct
True if a structure mxArray.
mxMalloc
Allocate dynamic memory using MATLAB's memory manager.
mxRealloc
Reallocate memory.
mxSetCell
Set the value of one cell.
mxSetData
Set pointer to data.
mxSetDimensions
Modify the number of dimensions and/or the size of each dimension.
mxSetField
Set a field value of a structure array, given a field name and an index.
mxSetFieldByNumber
Set a field value in a structure array, given a field number and an index.
mxSetImagData
Set imaginary data pointer for an mxArray.
mxSetIr
Set the ir array of a sparse mxArray.
mxSetJc
Set the jc array of a sparse mxArray.
mxSetLogical
Set the logical flag.
mxSetM, mxSetN
Set the number of rows (M) and columns (N) of an array.
mxSetNzmax
Set the storage space for nonzero elements.
mxSetPi, mxSetPr
Set the real and imaginary parts of an mxArray.


 Utility Functions Directory Organization