User`s guide
B Data Conversion
Array Formatting Flags
Excel Builder components have flags that control how array data is formatted
in both directions. Generally, you should develop client code that m atches the
intended inputs and outputs of the MATLAB functions with the corresponding
methods on the compiled COM objects, in accordance with the rules listed
in MATLAB to C OM VARIANT Conversion Rules on page B-5 and COM
VARIANT to MATLAB Conversion Rules on page B-10. In some cases this is
not p ossible, for examp le, when existing MATLAB code is used in conjunction
with a third-party product like Excel.
Thefollowingtableshowsthearrayformattingflags.
Array Formatting Flags
Flag Description
InputArrayFormat
Defines the array formatting rule used on input arrays.
An input array is a
VARIANT array, created
by th e client, sent as an input parameter
to a method call on a compiled COM object.
Valid values for this flag are
mwArrayFormatAsIs,
mwArrayFormatMatrix,andmwArrayFormatCell.
mwArrayFormatAsIs passes the array unchanged.
mwArrayFormatMatrix (default) formats all arrays
as matrices. When the input
VARIANT is of type
VT_ARRAY| type,wheretype is any numeric type,
this flag ha s no effect. When the input
VARIANT is of
type
VT_VARIANT|VT_ARRAY, VARIANTs in the array are
examined. If they are single-valued and homogeneous
in type, a MATLAB matrix of the appropriate type is
produced instead of a cell array.
mwArrayFormatCell interprets all arrays as MATLAB
cell arrays.
B-12