Using the C++ Math Library    

Array Indexing

Array indexing is implemented through the interaction of three classes: mwArray, mwSubArray, and mwIndex. When applied to an mwArray, operator() returns an mwSubArray. The mwSubArray ``remembers'' the indexing operation and defers evaluation until the result is either assigned or referred to.

You can pass an integer, double, mwArray, the contents of a cell or structure field, or an indexing expression as an argument to operator().

The mwArray class interface contains a series of operator() member functions that support n-dimensional indexing. Several of the functions are listed here.

This pair of operator() member functions supports one-dimensional indexing and indexing into arrays with more than 32 dimensions. The second non-const signature supports calls that are targets of the assignment operator and modify the contents of an array.

This pair of operator() member functions supports two-dimensional indexing The second non-const signature supports calls that are valid targets for the assignment operator.

This pair of operator() member functions supports the maximum number of arguments. To index into more than 32 dimensions, you must construct an mwVarargin object.


 Indexing and Subscripts Cell Content Indexing