Download MATLAB Compiler

Transcript
mwArray operator()(const char* name, mwIndex i1,
mwIndex i2, mwIndex i3, ..., )
Purpose
Return single element at specified field name and 1-based index in
struct array
C++
Syntax
#include "mclcppclass.h"
const char* fields[] = {"a", "b", "c"};
int index[2] = {1, 1};
mwArray a(1, 1, 3, fields);
mwArray b = a("a", 1, 1);
mwArray b = a("b", 1, 1);
Arguments
// b=a(1).a;
// b=a(1,1).b;
name
NULL-terminated string containing the field name to get.
i1, i2, i3, ...,
Comma-separated list of input indices.
Return
Value
An mwArray containing the value at the specified field name and index
Description
Use this method to fetch a single element at a specified field name
and index. This method may only be called on an array that is of type
mxSTRUCT_CLASS. An mwException is thrown if the underlying array is
not a struct array. The field name passed must be a valid field name
in the struct array. The index is passed by first passing the number
of indices, followed by an array of 1-based indices. This operator is
overloaded to support 1 through 32 indices. 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 offset 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). An mwException is
thrown if an invalid number of indices is passed in or if any index is
out of bounds.
D-87