I recently had a discussion with a friend about touch typing. Obviously, if you work on a computer all day, it is worth learning this technique to type fast without looking at the keyboard.
But what about Simulink? A lot of work is done using the mouse, so the touch typing configuration is less relevant. Are there guidelines or tips to build, edit, and navigate simulink models as efficiently as possible?
This week I share mine!
When navigating, I typically keep my thumb on the Alt key, my middle finger on the Esc key, and the index on the 1 key.
This allows me to easily do:
- Esc to go up one level with the middle finger
- Atl+1 to zoom 100%, using thumb on Alt and index on 1
- Space bar to zoom to fit with the thumb
- Alt+Tab to switch between windows, typically the Library Browser and the model, using thumb on Alt and index on Tab.
Here is a typical example of me exploring a model. This typically ends up being a pattern of hitting the Space bar when I enter a new subsystem to get the big picture, then Atl+1 to see the blocks zoomed at 100% and Esc to go up one level when I am done.
When editing, what I need the most are the Ctrl and Ctrl+Shift shortcuts. So I slightly move my left hand to keep my small finger on the Ctrl key, and my ring finger on the Shift key.
Here is the list of shortcuts I typically use in this configuration:
- Ctrl+Z to Undo
- Ctrl+X to Cut
- Ctrl+C to Copy
- Ctrl+V to Paste
- Ctrl+B to Build the model using Simulink Coder
- Ctrl+A to Select all blocks in the current system
- Ctrl+S to Save
- Ctrl+D to update the diagram (ALWAYS keep your model as close as possible to an updatable state, this will save you lots of debugging time!)
- Ctrl+G to Group selected blocks in one subsystem
- Ctrl+H to open the Model Explorer (am I the only one to pronounce it Model HHHexplorer because of that?)
- Ctrl+E to open the model configuration
- Ctrl+R to Rotate blocks
- Ctrl+T to start a simulation
- Ctrl+Y to redo something previously undone
- Ctrl+U to open a masked subsystem. With the introduction of the arrow badge, I use this shortcut less often since R2012b
- Ctrl+I to flip a block left-right. Ok, this one requires some intense stretching to be done with only one hand... be careful to not hurt yourself.
In addition go the Ctrl shortcuts, this hand position allows you to access a set of Ctrl+Shift shortcuts, by using the little finger for Ctrl, and the ring finger for Shift:
- Ctrl+Shift+X to Comment out and uncomment blocks
- Ctrl+Shift+Y to Comment through blocks
- Ctrl+Shift+H to remove highlighting in the model
- Ctrl+Shift+G to Expand a subsystem
- Ctrl+Shift+L to open the Simulink Library Browser. (This one cannot be done only with the left hand, but I thought I should point out his existence. Most of the time, when I edit model I alternate between the Library Browser and the model using Atl+Tab)
Since many Ctrl+Shift combinations do not have shortcuts assigned, I like to use those to assign custom shortcuts using an sl_customization file, as I previously highlighted in this post. One example for me is Ctrl+Shift+Z to display or not the name of blocks.
Here is an animation showing usage of the most common shortcuts:
Now it's your turn
Share your tricks to use Simulink as efficiently as possible by leaving a comment here.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.