This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Assign Signal Values to a Bus

This example shows how to use a Bus Assignment block to change a bus element value without adding Bus Selector and Bus Creator blocks to select bus elements and reassemble them into a bus.

Open the model and simulate it.

ans = 

  Simulink.SimulationOutput:
                   tout: [51x1 double] 

     SimulationMetadata: [1x1 Simulink.SimulationMetadata] 
           ErrorMessage: [0x0 char] 

Initially, the value of signal a is 1. However, the Bus Assignment block replaces that initial value of signal a with the value of signal c, which is 3. The const_bus output signal has a value of 3 for signal a, as the Display block shows.