matlab.system.propagatedInputDataType - Data type of input during Simulink propagation - MATLAB (original) (raw)
Main Content
Class: matlab.System
Data type of input during Simulink propagation
Syntax
dt = propagatedInputDataType(obj,index)
Description
[dt](#bt%5F01iy-1-dt) = propagatedInputDataType([obj](#bt%5F01iy-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8),[index](#mw%5F4747ba5e-4d46-4bd0-8d4d-5e2b66099af1))
returns the data type of an input argument for a System objectâ„¢. index
specifies the input for which to return the data type.
You can use propagatedInputDataType
only from withingetOutputDataTypeImpl
. Use getOutputDataTypeImpl
when:
- Your System object has more than one input or output.
- The input data type status determines the output data type.
- The output data type must differ from the input data type.
Input Arguments
System object handle used to access properties, states, and methods specific to the object. If your propagatedInputDataType
method does not use the object, you can replace this input with ~
.
Index of the specified input. Do not count the obj
in the index
. The first input is always obj
.
Output Arguments
Data type of the specified input, returned as a character vector for floating-point input or as a numerictype for fixed-point input.
Examples
Get the data type of the second input. If the second input data type is double
, then the output data type isint32
. For all other cases, the output data type matches the second input data type. Assume that the first input has no impact on the output.
methods (Access = protected) function dt = getOutputDataTypeImpl(obj) if strcmpi(propagatedInputDataType(obj,2),'double') dt = 'int32'; else dt = propagatedInputDataType(obj,2); end end end
Version History
Introduced in R2014a