C Math Library Reference    
mlfArrayRef

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

Arguments
mxArray *array
   Specifies the target array.

optional mxArray* arguments
   Specify the indices that form the subscript. Pass one index for one-dimensional indexing. Pass two indices for two-dimensional indexing.

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

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