matlab.System.supports1DVectorsImpl - Enable MATLAB System block to use 1-D signals for input and output - MATLAB (original) (raw)
Main Content
Class: matlab.System
Enable MATLAB System block to use 1-D signals for input and output
Since R2022b
Syntax
flag = supports1DVectorsImpl(obj)
Description
[flag](#mw%5F74003cf9-1650-4fac-98ce-e16501bbb44f) = supports1DVectorsImpl([obj](#mw%5F23605cd8-0c37-43b5-b9b6-46945a2961b4))
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
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
Flag to specify support for 1-D input and output, returned astrue
or false
. This value indicates whether theMATLAB System (Simulink) block recognizes vector input and output signals as 1-D. The default value if you do not include thesupports1DVectorsImpl
method is false
.
Examples
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 thegetOutputSizeImpl
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 thegetOutputSizeImpl
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