Main Content

Data Conversion Flags

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

VT_DATE

Valid values for this flag are

mwTypeDefault

mwTypeChar

mwTypeDouble

mwTypeSingle

mwTypeLogical

mwTypeInt8

mwTypeUint8

mwTypeInt16

mwTypeUint16

mwTypeInt32

mwTypeUint32

The default for this flag, mwTypeDefault, converts numeric data according to the rules listed in Data Conversion Rules.

InputDateFormat

This flag tells the data converter how to convert VARIANT dates to the MATLAB dates. Valid values for this flag are mwDateFormatNumeric (default) and mwDateFormatString. The default converts VARIANT dates according to the rule listed in VARIANT Type Codes Supported. The mwDateFormatString flag converts a VARIANT date to its character vector 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 Doubles 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 the MATLAB numeric date conversions. The default value of this property is 693960, which represents the difference between the COM Date type and the MATLAB numeric dates. This flag allows existing MATLAB code that already performs the increment of numeric dates by 693960 to be used unchanged with the MATLAB Compiler™ components. To process dates with such code, set this property to 0.