Guy on Simulink

Simulink & Model-Based Design

Predictive Quick Insert

Sometimes, I hear about a plan for a new feature without immediately realizing its impact... but it ends up fundamentally changing the way I use Simulink. Quick Block Insert is one such feature.

If you are not sure what I am talking about, Quick Block Insert is this feature that allows you to double-click in the canvas background and type block names to insert them. It is significantly faster than dragging blocks from the Simulink Library Browser.

Quick Insert

Today I want to highlight a new R2018b feature that improves the Quick Block Insert even more.

Quick Insert Suggestions Based on Context

In R2018b, when you drag a line from a block, you can double-click on the end of the line and the Quick Insert prompt will appear with a suggestion of blocks. Had you noticed this?

Quick Insert from signal

Depending on which block and port you are dragging from, the blocks proposed in the default list will be different. For example, if you pick a math block like the Gain block, we will propose other types of math blocks. For a Bus Creator, we will propose blocks more likely to be connected to a bus signal.

Quick Insert from signal

Simscape Domains

One context in which this feature is especially useful is with Simscape. The Quick Insert feature offers blocks specific to the domain of the port you are starting with. A mechanical translational port will offer mechanical translational blocks, while a hydraulic port will offer hydraulic blocks.

Quick Insert from Simscape Connections

I find that, when compared to launching the Quick Insert prompt from the canvas background, launching the Quick Insert prompt from a connection significantly reduces the number of characters I need to type to get the block I want.

Improve Quick Insert Results

Also starting in R2018b, the Quick Insert algorithm learns as you are using it. The blocks you are using the most in specific contexts will become the ones offered first after some time.

If you want to speed up the learning process, you can train the algorithm with existing models.

Functions slblocksearchdb.trainfrommodel or slblocksearchdb.trainfrommodelsindir, allow you to train the algorithm using a single model, or all the models in a specific directory. The more models you feed it, the more it will improve!

Now it's your turn

Are you taking advantage of the Quick Insert from a line in R2018b? Let us know what you think of this enhancement in the comments below.

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.