Main Content

Add Blocks to Models

A basic model takes an input signal, operates on the signal, and visualizes or logs the output. You can use blocks to generate or import an input signal, modify the signal, and plot the output signal or pass it to a workspace.

If you are unsure of which blocks to add to create your model, see Explore Available Blocks Using Library Browser.

Add Blocks to Models Using Quick Insert Menu

To add a block using the quick insert menu:

  1. At the location where you want to add the block, double-click the Simulink® canvas.

  2. Enter the name of the block that you want to add, or search for it by entering keywords.

  3. In the list of search results, select the block you want to add using the arrow keys, then press Enter.

    Note

    There can be multiple blocks with the same name that belong to different libraries. In each search result, the library appears below the block name. Check the library to make sure you choose the block you want to add.

The Quick insert menu has the search term "sine" in the search box. The list of search results is below the search box, with the entry for the Sine Wave block from the Simulink/Sources library highlighted in blue.

To add a block to the unconnected end of a signal line:

  1. Move your pointer over the end of the signal line. When your pointer is over the end of the signal line, it becomes a circle.

    A signal line is connected to a Gain block on one end, and unconnected on the other end. The pointer paused on the unconnected end of the signal line is a circle.

  2. Double-click the end of the signal line.

  3. Using the quick insert menu that appears, add the block. The new block is connected to the end of the signal line that you double-clicked.

Add Blocks to Models Using Library Browser

To add a block using the Library Browser:

  1. To open the Library Browser, in the Simulink Toolstrip, on the Simulation tab, in the Library section, click Library Browser.

  2. You can either do a keyword search for the block that you want to add or look for the block by navigating the Library Browser tree.

    To do a keyword search, in the Library Browser, in the search box, enter a keyword or key phrase, then press Enter. The search results appear in the Search Results tab. For more information, see Search for Library Items by Keyword.

    Tip

    To return to the Library Browser tree after a keyword search, click the Library tab.

  3. When you have found the block that you want to add, click and drag it from the Library tab or the Search Results tab to the Simulink canvas.

    Tip

    To add the block to the model, you can also do one of these actions:

    • Right-click the block in the Library Browser and select Add block to model.

    • Select the block and press Ctrl+I.

For more information about the Library Browser, see Library Browser.

Library Browser with the Library Browser button in the Simulink Toolstrip, the Library Browser tree, the search box, and the Library tab labeled

Explore Available Blocks Using Library Browser

If you are unsure of which block you want to add, you can explore the available blocks using the Library Browser.

To open the Library Browser, in the Simulink Toolstrip, on the Simulation tab, in the Library section, click Library Browser.

To explore the available blocks, expand the libraries in the tree. If you are looking for a block that:

  • Generates an input signal, try expanding the Simulink Library and then the Sources sublibrary.

    You can use a From Workspace block to import data from the workspace. You can use a From File block to import data from a file.

  • Operates on one or more signals, try expanding the Simulink Library, and then the Commonly Used Blocks or the Math Operations sublibrary.

    For example, if you want to add two signals together, you can use the Add block from the Math Operations sublibrary.

  • Outputs the simulation results, try expanding the Simulink Library, and then the Sinks sublibrary.

    You can use a Scope block to plot the simulation results. You can use a To Workspace block to pass simulation results to the workspace. You can use a To File block to save simulation results to a file.

For more information about the Library Browser, see Library Browser.

See Also

|

Related Topics