matlab.System.supportsMultipleInstanceImpl - Support System object in Simulink For Each subsystem - MATLAB (original) (raw)

Main Content

Support System object in Simulink For Each subsystem

Syntax

flag = supportsMultipleInstanceImpl(obj)

Description

[flag](#bue4%5Fbc-1-flag) = supportsMultipleInstanceImpl([obj](#bue4%5Fbc-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8)) 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 thesupportsMultipleInstanceImpl 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.

Run-Time Details

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

Method Authoring Tips

Input Arguments

expand all

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

Output Arguments

expand all

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

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

Version History

Introduced in R2014b