Skip to Main Content Skip to Search
Product Documentation

Performing Computations Without Using Subsystems

When to Perform Computations on Event-Based Signals Without Using Subsystems

In some situations, you can perform computations on an event-based signal by connecting it directly to computational blocks, without putting the blocks in an Atomic Subsystem or Function-Call Subsystem block. Direct connections make the model easier to construct.

How to Set Up Blocks for Computations

Insert computational blocks into your model and connect them directly to event-based signals. If the block has a Sample time parameter in the block dialog box, you must set Sample time to -1 to indicate an inherited sample time.

Behavior of Computations

When a connected set of computational blocks has event-based input signals, the behavior depends on whether the blocks are in a nonvirtual subsystem, such as an Atomic Subsystem or Function-Call Subsystem block.

For details about how blocks behave when they have event-based input signals and are not in a nonvirtual subsystem, see Execution of Blocks Having Event-Based Input Signals.

Refining the Behavior

Initial Value of Event-Based Signals

To change the initial value for any event-based signal that is not in a nonvirtual subsystem, connect the signal to the Initial Value block.

Migrating from Direct Connections to Atomic Subsystem

As you build your model, it might evolve from a situation in which direct connections of event-based signals to computational blocks is appropriate, to a situation in which it is better to perform the computation in an Atomic Subsystem block. Be alert to changes that your computation involves a block that has any of these characteristics:

To migrate your computation to an Atomic Subsystem block, see Creating an Atomic Subsystem from Existing Blocks.

Examples That Perform Computations Without Using Subsystems

  


Free Discrete Event Simulation Technical Kit

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS