Main Content
Reuse Multiple Instances of a Simulink Function
This example shows how to reuse instances of the same Simulink® function. The model slexCounterFunctionMdlRef
contains the
function, which implements a counter. Subsystems Update
CounterA
and CounterB
each contain an instance of the counter, allowing the model to reuse the function logic.
The calling notation CounterA.update
and CounterB.update
distinguishes the two different instances of the counter logic. As shown in this example, the model can call each instance from multiple blocks.