Main Content

supports1DVectorsImpl

Class: matlab.System

Enable MATLAB System block to use 1-D signals for input and output

Since R2022b

Syntax

flag = supports1DVectorsImpl(obj)

Description

flag = supports1DVectorsImpl(obj) specifies whether the MATLAB System (Simulink) block recognizes vector input signals and propagates vector output signals as 1-D.

By default, the MATLAB System (Simulink) block recognizes 1-D input signals and propagates 1-D output signals as 2-D. Use the supports1DVectorsImpl method to enable the block to recognize and propagate 1-D inputs and outputs as 1-D signals.

Run-Time Details

During Simulink® model compilation and propagation, the MATLAB System (Simulink) block calls the supports1DVectosImpl method to determine the dimensionality of vector input and output signals by checking if one dimensionality is supported for the block.

Method Authoring Tips

  • You must set Access = protected for this method.

  • In this method, you cannot modify any properties.

Input Arguments

expand all

System object handle used to access properties, states, and methods specific to the object. If your supports1DVectorsImpl method does not use the object, you can replace this input with ~.

Output Arguments

expand all

Flag to specify support for 1-D input and output, returned as true or false. This value indicates whether the MATLAB System (Simulink) block recognizes vector input and output signals as 1-D. The default value if you do not include the supports1DVectorsImpl method is false.

Examples

expand all

Specify in your class definition file that the System object used in Simulink with a MATLAB System (Simulink) block recognizes and propagates vector inputs and outputs as 1-D. Define the getOutputSizeImpl method to set the output size as identical to the input size.

methods (Access = protected)
   function flag = supports1DVectorsImpl(obj)
            flag = true; 
   end

   function sz = getOutputSizeImpl(obj)
            sz = propagatedInputSize(obj,1);    
   end
end

Specify in your class definition file that the System object used in Simulink with a MATLAB System (Simulink) block recognizes and propagates vector inputs and outputs as 1-D. Define the getOutputSizeImpl method to set the output size.

methods (Access = protected)
   function flag = supports1DVectorsImpl(obj)
            flag = true; 
   end

   function sz = getOutputSizeImpl(obj)
            sz = 3;    
   end
end

Version History

Introduced in R2022b