This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


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

Data types of output ports


[dt_1,dt_2,...,dt_n] = getOutputDataTypeImpl(obj)


[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 numeric object for fixed-point data types. The number of outputs must match the value returned from the getNumOutputs 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 or you need the output and input data types to be different, you must implement the getOutputDataTypeImpl method to define the output data type. For bus output, you must also specify the name of the output bus. You use propagatedInputDataType within the getOutputDataTypeImpl method to obtain the input type, if necessary.

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


System object™

Output Arguments


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


expand all

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';

Specify, in your class definition file, that the System object data type is a bus. You must also include a property to specify the bus name.

   OutputBusName = 'myBus'; 

methods (Access = protected)
   function out = getOutputDataTypeImpl(obj)
      out = obj.OutputBusName;
Was this topic helpful?