| MATLAB C Math Library | Search  Help Desk |
| mlfArrayRef | Examples See Also |
Handles one and two-dimensional indexed array references.
This routine is superseded by themlfIndexRef() routine, which supports multidimensional, cell array, and structure indexing.
C Prototype
mxArray *mlfArrayRef(mxArray *array, ... );
Arguments
mxArray *array
NULL as the last argument.
Return
This function returns a pointer to a newly allocatedmxArray that contains the result of the indexing operation.
Description
mlfArrayRef() extracts the elements specified by the subscript from the target array and returns the result in a new mxArray. mlfArrayRef() is the only indexing function to return a value.
Example
mxArray *two = mlfScalar(2), B; B = mlfArrayRef(A, two, two, NULL);This statement selects the element at row 2, column 2 in array
A and returns it in B.
See Also
mlfArrayAssign, mlfArrayDelete, mlfColon, mlfCreateColonIndex, mlfEnd