User`s guide

B Data Conversion
Data Conversion Rules
This topic describes the data co nv ersion rules for MATLAB Builder for Excel
components. These components are dual interface C OM objects that support
data types compatible with Automation.
Note Automation (formerly called OLE Automation) is a technology that
allows software packages to expose their unique features to scripting tools
and other applications. Automation u ses the Component Object Model (COM),
but may be implemented independently from other OLE features, such as
in-place activation.
When a method is invoked on an Excel Builder component, the input
parameters are converted to MATLAB internal array format and passed to the
compiled MATLAB function. When the function exits, the output parameters
are converted from MATLAB internal array format to COM Au to mation types.
The COM client passes all input and output arguments in the compiled
MATLAB functions as type
VARIANT.TheCOMVARIANT type is a union of
several simple da ta types. A typ e
VARIANT variable can store a variable o f any
of the simple types, as well as arrays of any o f t hese v alues.
The Win32 Applicatio n Program Interface (API) provides many functions for
creating and m anipulating
VARIANTs in C/C++, and Visual Basic provides
native language support for this type.
Note This discussion of data refers to both VARIANT and Variant data types.
VARIANT is the C++ name and Variant is the corresponding data type in
Visual Basic.
See the Visual Studio documentation for definitions and API support for COM
VARIANTs. VARIANT variables are self describing and store their type code
as an internal field of the structure.
The following table lists the
VARIANT type codes supported by Excel Builder
components.
B-2