Using the C Math Library    

Overview

Use the function mlfIndexAssign() to make assignments that involve indexing. The arguments to mlfIndexAssign() consist of a destination array, an index string, the index arrays themselves, 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.

You can use five different kinds of indices:

The examples in this section do not present all possible combinations of these index types. Assumptions for the Code Examples explains the conventions used in the examples.

The examples work with matrix A.

A =

There is no functional difference between two-dimensional indexed assignment and n-dimensional indexed assignment (where N > 2). Because it is easier to understand two-dimensional arrays, most of the examples in this section deal with two-dimensional arrays. See Extending Two-Dimensional Assignment to N Dimensions to learn how to work with n-dimensional arrays.


 Assigning Values to Array Elements Assigning to a Single Element