Guy on Simulink

Simulink & Model-Based Design

Community Favorite Accelerators 5

Posted by Seth Popinchalk,

In a recent post, I kicked off the discussion of Simulink workflow accelerators. The comments for that post were a great look at ways people work with Simulink. The discussion reminded me of some tricks I had forgotten about, and I learned some new ones. Do you know what you can do with the left and right mouse button when you click together? How about the Q key?

Viewing the model

Han Geerligs shared that his biggest accelerator is “using mouse and keyboard in conjunction.” The example he gave was using the Shift + mouse scroll wheel in order to pan horizontally. Use the mouse scroll wheel alone to pan vertically.

Using the scroll wheel to pan the diagram

Dan Lluch was nice enough to point out that “there are quite a few handy Simulink shortcut keys available” listed in the Doc. He likes the P and Q key, as well as the space bar and F key. If you use the mouse with your right hand (like me) you can push Q with your left, then click to drag the diagram view. If you are a left-handed mouse user, the P key will be more convenient. The developer who designed this feature uses the mouse with his left hand.

Pan the diagram with Q or P and the mouse

Editing the model

Phil Taylor livened up the discussion by reminding us of how to “disconnect a block without deleting it or the lines that connect to it.” Hold shift before you select and drag a block, it will disconnect rather than dragging the lines with it. This also works for groups of blocks.

Phil also proposed a workflow for surgically snipping the complicated lines in our diagram. “Imagine you’ve laid out a complicated connection path that feeds into lots of blocks (subsystems, scopes, displays, etc.) and you want to insert a block near the beginning of the path without deleting all the routing you’ve already laid down.” For single input, single output (SISO) blocks, this is as easy as just dropping the block on the line where you want to add the block. This will automatically insert the block into the line. If the block has multiple inputs and outputs, Phil suggests using SISO blocks to break the line and then deleting those blocks to get the signals you want.

I have reproduced this workflow with a little animation below.

Phils technique for breaking multiple lines

Devdatt Lad, a developer at the MathWorks, reminded me that you can “disconnect a block from a line without deleting it by using both mouse buttons simultaneously to select and drag it.”

Devdatt also pointed out the right click option to align, distribute and resize blocks.

Using the right click options to align and distribute blocks

Now it’s your turn

Are there other accelerators you use that we have not talked about here? How do you like the animated GIF files in this blog post? Leave a comment here and add to the conversation.

5 CommentsOldest to Newest

Kai replied on : 1 of 5

I’m using R14sp3. The latter mentioned trick “right click option to align, distribute and resize blocks” doesn’t work, does it?

Liu Yingpei replied on : 2 of 5

Dear Seth, I’m using Matlab 7.1, and I find that the latter mentioned trick “right click option to align,distribute and resize blocks” does not work.

Seth replied on : 3 of 5

@Liu Yingpei – The align, distribute and resize blocks options were introduced in R2007b (MATLAB 7.5, Simulink 7.0).

Joe replied on : 4 of 5

Simulink needs the ability to pan the diagram even when all the contents are in view (e.g. after hitting ‘space’). Say I need to add something to the left but there’s no space. Then you have to select all, move to the right, and then can add in your block… much better if you could just quickly pan everything right.

Seth replied on : 5 of 5

@Joe – Thanks for the comment. This is a capability we are considering for a future release of Simulink. Stay tuned!

Add A Comment

Your email address will not be published. Required fields are marked *

*

Preview: hide