supportsMultipleInstanceImpl

Support System object in Simulink For Each subsystem

Syntax

flag = supportsMultipleInstanceImpl(obj)

Description

flag = supportsMultipleInstanceImpl(obj) specifies whether the System object™ can be used in a Simulink® For Each subsystem via the MATLAB System block. To enable For Each support, you must include the supportsMultipleInstanceImpl in your class definition file and have it return true. Do not enable For Each support if your System object allocates exclusive resources that may conflict with other System objects, such as allocating file handles, memory by address, or hardware resources.

During Simulink model compilation and propagation, the MATLAB System block calls the supportMultipleInstance method, which then calls the supportsMultipleInstanceImpl method to determine For Each support.

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

flag

Boolean value indicating whether the System object can be used in a For Each subsystem. The default value, if you do not include the supportMultipleInstance method, is false.

Examples

expand all

Specify in your class definition file that the System object can be used in a Simulink For Each subsystem.

methods (Access = protected)
   function flag = supportsMultipleInstanceImpl(obj)
       flag = true;
   end
end
Was this topic helpful?