C Math Library Reference | ![]() ![]() |
Handles one and two-dimensional indexed array references.
This routine is superseded by the mlfIndexRef
() routine, which supports multidimensional, cell array, and structure indexing.
C Prototype
mxArray *mlfArrayRef(mxArray *array, ... );
Arguments
mxArray *array
Specifies the target array.
Terminate the argument list by passing NULL
as the last argument.
Return
This function returns a pointer to a newly allocated mxArray
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
![]() | mlfArrayDelete | mlfAssign | ![]() |