getOutputDataTypeImpl
Data types of output ports
Syntax
[dt_1,dt_2,...,dt_n] = getOutputDataTypeImpl(obj)
Description
[dt_1,dt_2,...,dt_n] = getOutputDataTypeImpl(obj)
returns the data
type of each output port as a character vector for built-in data types or as a numerictype
(Fixed-Point Designer)
object for fixed-point data types. The number of outputs must match the value returned from
the getNumOutputsImpl
method or the number of
output arguments listed in the stepImpl
method.
For System objects with one input and one output and where you want the input and output
data types to be the same, you do not need to implement this method. In this case,
getOutputDataTypeImpl
assumes the input and output data types are the
same and returns the data type of the input.
If your System object™ has more than one input or output, and you use propagation, you must set the
output data types in the getOutputDataTypeImpl
method. For Simulink®, if the input and output data types are different, you might have to cast the
output value to the data type of the appropriate dt_n
output argument. You
specify this casting in the stepImpl
method. For bus output, you must
specify the name of the output bus in getOutputDataTypeImpl
.
If needed to determine the output data type, you can use propagatedInputDataType
within the getOutputDataTypeImpl
method to obtain the input type.
Run-Time Details
getOutputDataTypeImpl
is called by the MATLAB System block.
Method Authoring Tips
You must set
Access = protected
for this method.You cannot modify any properties in this method.
If you are debugging your code and examine the data types before Simulink completes propagation, you might see outputs with empty, [ ], data types. This occurs because Simulink has not completed setting the output data types.
Input Arguments
Output Arguments
Examples
Version History
Introduced in R2013b