User`s guide
mwArray Get(mwSize num_indices, ...)
Purpose Return single element at specified 1-based index
C++
Syntax
#include "mclcppclass. h"
double data[4] = {1.0, 2.0, 3.0, 4.0};
double x;
mwArray a(2, 2, mxDOUBLE_CLASS);
a.SetData(data, 4);
x = a.Get(1,1); // x = 1.0
x = a.Get(2, 1, 2); // x = 3.0
x = a.Get(2, 2, 2); // x = 4.0
Arguments num_indices
Number of indices passed in
...
Comma-separated list of input indices. Number of items must
equal
num_indices.
Return
Value
An mwArray containing the value at the specified index.
Description Use this m ethod to fetch a single element at a specified index. The
index is p as sed by first passing the number of indices follo wed by
a comma-separate d list of 1-based i ndices. The valid number of
indices that can be passed in is either 1 (single subscript indexing),
in which case the element at the specified 1-based offse t is returned,
accessing data in column-wise order, or
NumberOfDimensions()
(multiple subscript indexing), in which case, the index list is used
to access the specified element. The valid range for indices is
1 <= index <= NumberOfElements(), for single subscript indexing.
For multiple subscript indexing, the ith index has the valid range:
1 <= index[i] <= GetDimensions().Get(1, i).AnmwEx cept ion is
thrown if an invalid number of indices is passed in or if any index is
out of bounds.
C-69