C Math Library Reference    
mlfIndexAssign

Assign a value to an element (or elements) in the target array

C Prototype

Arguments
mxArray **pa
   Specifies the address of the target array that will be modified.

const char* index_string
   A string that specifies the dimensionality of the subscript and the style of indexing (array indexing or cell array indexing) that is applied to the target array. Use a ? in place of each index value, for example, "(?,?)". mlfIndexRef() does not use index values specified in the subscript string.

Additional arguments
   [Optional] Arrays that specify the values of the indices followed by the source array. Provide one index for one-dimensional indexing, two for two-dimensional indexing, n indices for n-dimensional indexing.

You do not need to terminate the list of arguments with NULL; the indexing functions can detect the number of expected arguments.

Return

Returns a pointer to the modified array.

Description

Use the function mlfIndexAssign() to make array assignments that involve indexing. The arguments to mlfIndexAssign() consist of the destination array, an index string that specifies the elements that are to be modified in the destination array, one or more index arrays that specify the value for the subscript, and the source array.

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.

Example

This code 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.

                  mlfScalar(45)); /* Source array */

See Also

mlfIndexRef, mlfIndexDelete


 mlfFevalTableSetup mlfIndexDelete