Documentation Center

  • Trials
  • Product Updates

Add 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.

Add 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 Populate a Model for more information.

Copy Blocks from a Model

To copy a block from a model in the Simulink® Editor:

  1. Select the block that you want to copy from a model.

  2. Choose Edit > Copy.

  3. In the model window in which you want to place the copied block, choose Edit > Paste.

You can copy a block:

  • Within the same model window

  • Between multiple systems open in one Simulink Editor instance

  • Between systems open in multiple Simulink Editor instances

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

For details, see Copy Blocks Between Windows.

Add Frequently Used Blocks

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

Selecting Your Frequently Used Blocks From the Library Browser

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

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

  • Drag the block into your model.

  • Right-click the block, and from the context menu select Add to <model_name>.

Select Frequently Used Blocks from the Model Editor

In the Simulink 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 on the Frequently Used Tab?

The Frequently Used tab 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:

  • Does not already include the Gain block

  • Has less than 25 blocks

  • Has 25 blocks, but you added more Gain blocks than the number of instances of the least frequently used block in 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:

  • Add programmatically

  • Include in subsystems

    If you add a subsystem that uses a specific type of block repeatedly, the list does not reflect that activity.

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

Add 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.

Was this topic helpful?