getOutputDataTypeImpl

Class: matlab.system.mixin.Propagates
Package: matlab.system.mixin

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 types of each output port. The number of outputs must match the value returned from the getNumOutputs method or the number of output arguments listed in the step 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 or you need the output and input data types to be different, you must implement the getOutputDataTypeImpl method to define the output data type. You also must implement the propagatedInputDataType method.

During Simulink® model compilation and propagation, the MATLAB System block calls the getOutputDataType method, which then calls the getOutputDataTypeImpl method to determine the output data type.

    Note:   You must set Access = protected for this method.

    You cannot modify any properties in this method.

Input Arguments

obj

System object™ handle

Output Arguments

dt_1,dt_2,...

Data type of the property. For built-in data types, dt is a string. For fixed-point data types, dt is a numerictype object.

Examples

expand all

Specify Output Data Type

Specify in your class definition file the data type of a System object with one output.

methods (Access = protected)
   function dt_1 = getOutputDataTypeImpl(~)
      dt_1 = 'double';
   end
end
Was this topic helpful?