Seth on Simulink

June 25th, 2008

Community Favorite Accelerators

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.

3 Responses to “Community Favorite Accelerators”

  1. Kai replied on :

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

  2. Liu Yingpei replied on :

    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.

  3. Seth replied on :

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

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Seth Popinchalk is an Application Engineer for The MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design.
  • wei: @Ashish, I agree with your observation on compiler optimization but fail to see why Han’s code would be...
  • Ashish Sadanandan: Han, Sorry for butting in with a reply, but the modification to the for-loop you’ve...
  • arun kumar: dear seth i have been involved in developing and simulating asynchronous systems for my VLSI lab. in...
  • Han Geerligs: Hi Aarti, thanks for providing the example! I was just wondering why the lines model_YDim = model_XDim;...
  • Seth: @Han - Aarti’s response is in a post titled Generated Code for Variable Size Signals.
  • garla: what is advantage of exporting the bus object with the format as “cell” and “object” ....
  • J.r: @ Guy - Example sent to your account. Thank you.
  • Guy: @ J.r - The ability for atomic subsystems and Model Reference to remove the “fake algebraic loop”...
  • J.r: Sorry to hit an old thread, but this seems like the best place to solicit help on this topic. Is there supposed...
  • Bindu: please tell me how can i get the sampling time used in simulation

These postings are the author's and don't necessarily represent the opinions of The MathWorks.