Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Adding Blocks

Ways to Add Blocks

You can add blocks to a model in several ways.

MethodWhen to Use
Browse or search libraries with the Library Browser
  • You are not sure which block to add.

  • You do not have a familiar model from which to copy blocks.

Copy blocks from a model
  • You know where in a model a block is that you want to copy.

  • You want to replicate many of the parameter settings of an existing block.

Use the Most Frequently Used Blocks pane or context menu
  • You want to add a block that you have used frequently and recently.

  • You are working on multiple models that share several of the same blocks.

  • You do not have a familiar model from which to copy similar blocks.

Add blocks programmatically with the add_block function
  • You want to replicate most of the parameter settings of a block.

  • You are working on multiple models that share several of the same blocks.

Adding Blocks by Browsing or Searching with the Library Browser

To browse or search for a block from a block library installed on your system, use the Library Browser. You can browse a list of block libraries or search for blocks whose names include the search string you specify.

When you find the block you want, select that block in the Library Browser and drag the block into your model. See Populating a Model for more information.

Copying Blocks from a Model

To copy a block from a model in the Model Editor:

  1. Select the block you want to copy.

  2. Choose Edit > Copy.

  3. If you have multiple model windows open, make the target model window the active window.

  4. Choose Edit > Paste.

When you copy a block, the parameters use default values.

See Copying and Moving Blocks from One Window to Another for details.

Adding Frequently Used Blocks

When using the same block repeatedly, you can save time by using the Most Frequently Used Blocks feature in the Library Browser or Model Editor.

Selecting Your Most Frequently Used Blocks From the Library Browser

Open the Most Frequently Used Blocks pane with the third tab in the Library Browser.

To add a block to a model, select the block from the list and do either one of the following:

Selecting Your Most Frequently Used Blocks from the Model Editor

In the Model Editor, you can view a list of your most frequently used blocks. Right-click anywhere in the model except with the cursor directly on a block or signal. In the context menu, select Most Frequently Used Blocks.

What Blocks Appear in the Most Frequently Used Blocks Lists

The Most Frequently Used Blocks pane lists blocks that you have added most often, with the most frequently used block at the top. The list reflects your ongoing modeling activity. For example, if you add several Gain blocks, the Gain block appears in the list if the list:

The list displays blocks that you rename as instances of the library block. For example, if you rename several Gain blocks to be MyGain1, MyGain2, and so on, those blocks count as Gain blocks.

When you close and reopen the Library Browser, the list reflects the blocks that you added up through the previous session. The list updates only when the Library Browser is open.

The list does not reflect blocks that you:

The list in the Model Editor is the same as the Library Browser list, except that the Model Editor list includes only five blocks.

Adding Blocks Programmatically

To add a block programmatically, use the add_block function.

The add_block function copies the parameter values of the source block to the new block. You can use add_block to specify values for parameters of the new block.

  


Related Products & Applications

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

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