Skip to Main Content Skip to Search
Product Documentation

Connecting Blocks in the Simple Model

Block Connections in a Model

After you add blocks to your model, you need to connect them. The connecting lines represent the signals within a model.

Most blocks have angle brackets on one or both sides. These angle brackets represent input and output ports:

Drawing Lines Between Blocks

Connect the blocks by drawing lines between output ports and input ports. For how to add blocks to the model in this example, see Adding Blocks to a Model.

  1. Position your mouse pointer over the output port on the right side of the Sine Wave block.

    The pointer changes to a cross hairs (+) shape while over the port.

  2. Click and drag a line from the output port to the top input port of the Mux block.

    While you hold the mouse button down, the connecting line appears as a dashed line.

  3. Release the mouse button over the output port.

    Simulink connects the blocks with an arrow indicating the direction of signal flow.

  4. Drag a line from the output port of the Integrator block to the bottom input port on the Mux block.

    The Integrator block connects to the Mux block with a signal line.

  5. Select the Mux block, hold down the Ctrl key, and then select the Scope block.

    A line is drawn between the blocks to connect them. Your model should now look similar to the following figure.

      Note   The Ctrl+click shortcut is useful when you are connecting widely separated blocks, or when working with complex models.

Drawing a Branch Line

The simple model is almost complete, but one connection is missing. To finish the model, you need to connect the Sine Wave block to the Integrator block.

This final connection is different from the other three connections, which all connect output ports to input ports. Because the output port of the Sine Wave block is already connected, you must connect this existing line to the input port of the Integrator block. The new line, called a branch line, carries the same signal that passes from the Sine Wave block to the Mux block.

  1. Position the mouse pointer on the line between the Sine Wave and the Mux block.

  2. Hold down the Ctrl key, and then drag a line to the input port of the Integrator block input port.

  3. From the File menu, click Save. Your model is now complete.

After you finish building a model, you can simulate the dynamic behavior of the model. See Simulating the Simple Model.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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