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. You can also use blocks organize the content of your models into reusable components.
To add blocks to a model, or to help you decide which blocks to add to your model, use the quick insert menu or the Library Browser. To get information about a specific block, use the quick insert menu. To browse the available blocks, use the Library Browser.
For blocks that represent certain components, you have a third option. You can add Model, Subsystem, or Reference Component (System Composer) blocks to a model using the quick insert menu or Library Browser, or you can drag the file you want the block to reference into the model canvas. See Add Components by Dragging Files Into Canvas for details.
Add Blocks to Models Using Quick Insert Menu
To add a block using the quick insert menu:
At the location where you want to add the block, double-click the Simulink® canvas.
Enter the name of the block that you want to add, or search for it by entering keywords.
In the list of search results, select the block you want to add using the arrow keys, then press Enter.
There can be multiple blocks with the same name that belong to different libraries. Before you press Enter, make sure the selected block is the block you want to add by checking the library name located underneath the block name and the information in the details pane located to the right of the search results.
To add a block to the unconnected end of a signal line:
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.
Double-click the end of the signal line.
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.
Get Information About Blocks Using Quick Insert Menu Details Pane
You can get information about a block using the quick insert menu. Select a block in the search results, and then view the details pane to the right of the search results. You can use the details pane to complete these tasks.
Task | How to Complete Task |
---|---|
Open the block library, for example to explore other blocks in the library. | Click the hyperlink under the block name. If a block is in multiple libraries, you might see multiple hyperlinks. |
Determine whether a block is the one you are looking for (there can be multiple different blocks with the same name). | Read the block description. |
Look up information about a block. | Click Learn More . |
Learn about related blocks and topics. | Click the hyperlinks under See Also. |
View an example of how to use a block. | Click the hyperlinks under Examples. |
To hide the details pane, click the arrow . To show the details pane, click the arrow again.
Add Blocks to Models Using Library Browser
To add a block using the Library Browser:
To open the Library Browser, in the Simulink Toolstrip, on the Simulation tab, in the Library section, click Library Browser.
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.
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.
Browse Available Blocks Using Library Browser
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 Sum 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.
Add Components by Dragging Files Into Canvas
You can add the components listed in the table to a model by dragging files into the model canvas. The components you create using the drag to add approach are preconfigured to reference the contents of the file you drag. For example, dragging an SLX file into the Simulink model canvas adds a Model block that references the model in the SLX file.
Files that you drag to the canvas must be on the MATLAB® path. Creating components by dragging files from the MATLAB Editor into the model canvas is not supported.
Component | How to Add Component to Model |
---|---|
Model block | Drag the model file containing the model you want to reference into the Simulink model canvas. |
Subsystem block | Drag the subsystem file containing the subsystem you want to reference into the Simulink model canvas. |
Reference Component (System Composer) block | Drag the model file containing the model you want to reference or the subsystem file containing the subsystem you want to reference into the architecture model canvas. |
See Also
Library Browser | Library Browser in Standalone Mode