User`s guide
B Data Conversion
COM VARIANT to MATLAB Conversion Rules
VARIANT Type
MATLAB Data Type
(scalar or array
data) Comments
VT_EMPTY
N/A Empty array created.
VT_I1 int8
VT_UI1 uint8
VT_I2 int16
VT_UI2 uint16
VT_I4 int32
VT_UI4 uint32
VT_R4 single
VT_R8 double
VT_CY double
VT_BSTR char
A VARIANT of type VT_BSTR converts to a
1-by-L MATLAB
char array, where L =
the length of the string to be converted.
A
VARIANT of type VT_BSTR|VT_ARRAY
converts to a MATLAB cell array of 1-by-L
char arrays.
VT_ERROR int32
VT_DATE double
1. VARIANT dates a re stored as doubles
starting at midnight Dec. 31, 1899.
MATLAB dates are stored as doubles
starting at 0/0/00 00:00:00. Therefore, a
VARIANT date of 0.0 maps to a MATLAB
numeric date of 693960.0.
VARIANT
dates are converted to MATLAB double
types and incremented by 693960.0.
2.
VARIANT dates can be optionally
converted to strings. See “Data Conversion
Flags” on page B-14 for more information
on type coercion.
B-10