MATLAB COM Builder | ![]() ![]() |
Data Conversion Flags
MATLAB COM Builder components contain flags to control the conversion of certain VARIANT
types to MATLAB types.
CoerceNumericToType
This flag tells the data converter to convert all numeric VARIANT
data to one specific MATLAB type. VARIANT
type codes affected by this flag are VT_I1
, VT_UI1
, VT_I2
, VT_UI2
, VT_I4
, VT_UI4
, VT_R4
, VT_R8
, VT_CY
, VT_DECIMAL
, VT_INT
, VT_UINT
, VT_ERROR
, VT_BOOL
, and VT_DATE
. Valid values for this flag are mwTypeDefault
, mwTypeChar
, mwTypeDouble
, mwTypeSingle
, mwTypeLogical
, mwTypeInt8
, mwTypeUint8
, mwTypeInt16
, mwTypeUint16
, mwTypeInt32
, and mwTypeUint32
. The default for this flag, mwTypeDefault
, converts numeric data according to the rules listed in Table B-3.
InputDateFormat
This flag tells the data converter how to convert VARIANT
dates to MATLAB dates. Valid values for this flag are mwDateFormatNumeric
(default) and mwDateFormatString
. The default converts VARIANT
dates according to the rule listed in Table B-3. mwDateFormatString
converts a VARIANT
date to its string representation. This flag only affects VARIANT
type code VT_DATE
.
OutputAsDate As Boolean
This flag instructs the data converter to process an output argument as a date. By default, numeric dates that are output parameters from compiled MATLAB functions are passed as Double
s that need to be decremented by the COM date bias (693960) as well as coerced to COM dates. Set this flag to True
to convert all output values of type Double
.
DateBias As Long
This flag sets the date bias for performing COM to MATLAB numeric date conversions. The default value of this property is 693960, which represents the difference between the COM Date
type and MATLAB numeric dates. This flag allows existing MATLAB code that already performs the increment of numeric dates by 693960 to be used unchanged with COM Builder components. To process dates with such code, set this property to 0.
![]() | Array Formatting Flags | Registration and Versioning | ![]() |