C Math Library Reference    
mlfArrayAssign

Handles assignments that include one and two-dimensional indexing.

This routine is superseded by the mlfIndexAssign() routine, which supports multidimensional, cell array, and structure indexing.

C Prototype

Arguments
mxArray *destination
   Specifies the destination array that will be modified.

mxArray *source
   Specifies the source array that contains the new values for the destination array.

optional mxArray* arguments
   Specify one or two indices that form the subscript for the destination array.

Terminate the argument list by passing NULL as the last argument.

Return

This function returns void. The result of the assignment is stored in the argument destination.

Description

Use the function mlfArrayAssign() to make assignments that involve indexing. The arguments to mlfArrayAssign() consist of a destination array, a source array, and one or two index arrays that represent the subscript. The subscript specifies the elements that are to be modified in the destination array; the source array specifies the new values for those elements. The subscript is only applied to the destination array.

The functions are defined to accept a variable number of indices. Supply one index mxArray argument to perform one-dimensional indexing. Supply two index mxArray arguments to perform two-dimensional indexing.

Example

writes the value 45 into the element at row three, column one of array A. If you assign a value to a location that does not exist in the array, the array grows to include that element.

See Also

mlfArrayDelete, mlfArrayRef, mlfColon, mlfCreateColonIndex, mlfEnd


 Utility Routine Reference mlfArrayDelete