propagatedInputDataType

Class: matlab.System

Data type of input during Simulink propagation

Syntax

dt = propagatedInputDataType(obj,index)

Description

dt = propagatedInputDataType(obj,index) 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 within getOutputDataTypeImpl. 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

expand all

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

expand all

Data type of the specified input, returned as a character vector for floating-point input or as a numerictype for fixed-point input.

Examples

expand all

Get the data type of the second input. If the second input data type is double, then the output data type is int32. 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

Introduced in R2014a