Main Content

Keyboard Shortcuts and Mouse Actions for Simulink Modeling

Keyboard shortcuts and mouse actions can help you efficiently model systems in Simulink®. To open this page from a model, press Shift+? or click the Keyboard Shortcuts button on the navigation bar.

Note

When you use these keyboard shortcuts on a Mac, press command (⌘) instead of Ctrl.

Use Context-Sensitive Hints Panels to Look Up Keyboard Shortcuts

When you are in any of these modes, you can view a hints panel that displays keyboard shortcuts specific to the active mode.

ModeDefinitionHow to Enter ModeHow to View Hints Panel
SelectionUse the arrow keys to select a different block.Select a block in your model. Press M to switch from movement mode (the default) to selection mode.The panel appears when you enter selection mode.
MovementUse the arrow keys to move the selected block.

When you open Simulink, you are in movement mode by default.

To switch from selection mode to movement mode, press M.

The panel appears when you switch from selection mode to movement mode.

To hide the panel, click the canvas.

Signal highlighting

Highlight signal lines between the selected block and the signal source or destination.

Display port values.

Click a signal in your model. Pause on the ellipsis that appears. In the action menu that expands, click either Highlight Signal to Source Highlight Signal to Source Button or Highlight Signal to Destination Highlight Source to Destination Button.

The panel appears when you enter signal highlighting mode.
Pan and zoomPan to move the view over the model. Zoom to change how close the model appears.When you open Simulink, you are in pan and zoom mode by default.

Press and hold the space bar until the hints panel expands. If the panel is minimized, press and hold the space bar until the ? button ? button appears.

To hide the panel, click the canvas.

The left image shows a model in keyboard selection mode with the hints panel expanded in the lower right corner of the model window. The ? button is in the lower right corner of the expanded hints panel. The right image shows the same model in the same mode with the panel minimized. Only the ? button is visible in the lower right corner.

To minimize the panel, press ? on your keyboard. When the panel is minimized, only the ? button ? button is visible.

To restore the panel, press ? on your keyboard.

Note

The hints panel of each mode preserves its state, minimized or expanded, across MATLAB® sessions.

Perform File and Clipboard Operations

TaskShortcut
Open modelCtrl+O
Create modelCtrl+N
Print modelCtrl+P
Save all modified models in current model hierarchyCtrl+S
Save current referenced modelCtrl+Shift+S
Close modelCtrl+W
CutCtrl+X
PasteCtrl+V
DuplicateCtrl+C, Ctrl+V
UndoCtrl+Z
RedoCtrl+Y, Ctrl+Shift+Z ( Simulink Online™)
Find search stringCtrl+F

Zoom and Pan

TaskAction
Fit diagram to windowSpace bar
Fit selection to windowSpace bar + F
Zoom inCtrl+Plus (+) or space bar + Plus (+)
Zoom outCtrl+Minus (-) or space bar + Minus (-)
Zoom to 100%Ctrl+0, Alt+1, or space bar + 0
Zoom with scroll wheel

Scroll wheel

Ctrl + scroll wheel when Scroll wheel controls zooming is cleared

Zoom in on block diagram elementDrag the Zoom button from the palette to the element.
View visible portion of block diagram relative to full block diagram with miniature map

Zoom or pan to part of the block diagram.

Press and hold the space bar when only part of the block diagram is visible.

View different portion of block diagramClick the destination in the miniature map.
Pan

Drag the highlighted area in the miniature map.

Drag with middle button.

Space bar + drag.

Space bar + left, right, up, or down arrow

Pan verticallyCtrl + scroll wheel
Pan horizontallyShift + scroll wheel
Pan by pageShift + space bar + left, right, up, or down arrow

Navigate Model

TaskShortcut
Open model

Double-click.

Enter

Change tabsCtrl+Shift+Tab
Go to parent of current subsystem, referenced model, or Stateflow® stateEsc
Look under block maskCtrl+U
For linked blocks, go to library of parent blockCtrl+L
Open the Model ExplorerCtrl+H

Modify Block Diagram Contents

TaskAction
Insert block at current location with the quick insert menu

Double-click the Simulink Editor canvas and start typing the block name, then select the block from the menu.

Ctrl+Period (.) twice and start typing the block name, then press the down arrow to select the block from the list and Enter to insert the block.

On AZERTY keyboards, press Ctrl+Shift+Period (.) instead of Ctrl+Period (.).

Get prompted for suggested block based on contextDouble-click the end of a line drawn from an existing block, then select a suggestion from the list or start typing to select one from the library.
Open the Library BrowserCtrl+Shift+L
Insert annotation at current location with the quick insert menu

Double-click the Simulink Editor canvas and type the annotation content, then select the annotation option.

Ctrl+Period (.) twice and type the annotation content, then press the down arrow to select the annotation option and Enter to insert the annotation.

On AZERTY keyboards, press Ctrl+Shift+Period (.) instead of Ctrl+Period (.).

Copy selected block diagram elements

Drag elements with the right mouse button.

Ctrl + drag.

Copy selected block diagram elements between Simulink Editor windowsDrag elements between windows.
Delete selected block diagram elementsDelete or Backspace

Select Block Diagram Elements

Selected elements have a solid blue outline. The most recently selected element has blue corner brackets in addition to the outline. To represent the cursor when you use the keyboard for selection, a blue box with dashed lines surrounds the element.

The Product block is selected, the Gain block was selected most recently, and the cursor is on the Sum block.

TaskAction
After clicking or moving elements, access keyboard shortcuts for selecting elements

M to toggle between modifying selection and moving selected elements.

Change selection to closest similar element in a direction

Left, right, up, or down arrow

Move cursor to closest element in a direction, regardless of similarity

Ctrl+Shift + left, right, up, or down arrow

Change selection to element at top-left of canvas

Ctrl+Home

On a Mac, press home.

Change selection to element at bottom-right of canvas

Ctrl+End

On a Mac, press end.

Change selection to leftmost element relative to cursor

Home

On a Mac, press control+left.

Change selection to rightmost element relative to cursor

End

On a Mac, press control+right.

Select additional adjacent elements

Drag from empty position.

Shift + left, right, up, or down arrow

Select additional elements that are not adjacent

Shift + click.

Ctrl + left, right, up, or down arrow to change the current element. Ctrl + space bar to add the current element to the selection.

On a Mac, to add the current element to the selection, press command+shift + space bar or shift + space bar.

Select all blocks, lines, and annotationsCtrl+A
Select portsPoint to the port region of a connected port to view and interact with the underlying port instead of the signal line.
Clear selectionCtrl+Alt+A

Modify Block Diagram Elements

TaskShortcut
Set main parameter for selected blockAlt+Enter
Open or hide the Property InspectorCtrl+Shift+I
Connect blocks

Click a port. Click the blue chevron symbol port hint symbol that appears near a compatible port you want to connect to.

Select the first block, then Ctrl + click a second block.

Drag from port to port.

Click a port and hold Shift as you connect to the next port. Hold Shift to make multiple, consecutive connections.

Branch line

Click a port, move the cursor near the line you want to branch, and then click after you see the preview.

Select a line, move the cursor toward the element you want to connect with, and then click the blue chevron symbol port hint symbol that appears near the port.

Ctrl + drag line.

Right mouse button + drag.

Add ports to blocks that take multiple inputs

Drag toward the port from a compatible block or signal line.

Drag from the edge of the block that you want to add the port to.

Click the edge of the port, and then drag.

Click the edge of the port, move the cursor over the signal type — signal, bus, or connector — from the menu, and drag.

Comment through selected blocksCtrl+Shift+Y
Comment out or uncomment selected blocksCtrl+Shift+X
Disconnect selected blocks

Shift + drag block.

After selecting blocks with the keyboard, press M then Shift + left, right, up, or down arrow.

Name Block Diagram Elements

TaskAction
Rename selected block diagram element

Click or double-click the label.

Select the element and press F2.

On a Mac, press command+return instead of F2.

Name signal lineDouble-click the signal and type its name.
Display name on branch of a named signal lineDouble-click the branch.
Name every branch of a signal Right-click the signal, select Properties, and use the dialog box.
Delete signal label and nameDelete characters in the label, or delete the name in Signal Properties dialog box.
Delete signal label only Right-click the label and select Delete Label.
Copy signal labelCtrl + drag the signal label.
Edit port labels on subsystem blocks

Point to the port label and click the interactive cue (blue box surrounding the label).

Select the port. Click the port label cue or press F2.

To switch between block name and signal name when editing labels on signal ports, press Ctrl+1,2.

To make successive port label edits on a subsystem block:

  • Select a port on the block, edit the label and press Enter. This enables keyboard selection of ports.

  • Use up or down arrow keys to select adjacent ports and press F2 for quick editing.

Modify Block Diagram Appearance

TaskAction
Move any block diagram element, including signal labelsDrag element.
Move selected elements

Drag one of the selected elements.

Drag selection box.

After selecting elements with the keyboard, press M then the left, right, up, or down arrow.

Automatically arrange block diagramCtrl+Shift+A
Resize block, maintaining ratio of width and heightShift + drag handle
Resize block from the centerCtrl + drag handle
Route lines around blocksShift + drag while drawing
Rotate blocks clockwiseCtrl+R
Rotate blocks counterclockwiseCtrl+Shift+R
Flip blocksCtrl+I
Create subsystem from selectionCtrl+G
Create subsystem or area from empty selection

To create the highlighted option, which you can change by using the arrow keys or mouse:

  • Click inside the selection box.

  • Press Enter.

Press the number key associated with an option.

Change signal label fontSelect the signal line (not the label), then on the Format tab, click the Font Properties button arrow, then click Fonts for Model.
Mask blockCtrl+M
Refresh Model blocksCtrl+K

Perform Actions

TaskShortcut
Perform generic action with the quick action search menu

Double-click the Simulink Editor canvas, select the Actions tab, and start typing the action name or description, then select the action from the list.

Ctrl+Period (.) and start typing the action name or description, then press the down arrow to select the action and Enter to perform it.

On AZERTY keyboards, press Ctrl+Shift+Period (.) instead of Ctrl+Period (.).

Perform context-sensitive action

Before opening the quick action search menu, select a block diagram element.

Update, Simulate, and Generate Code for Models

TaskShortcut
Open Configuration Parameters dialog boxCtrl+E
Update modelCtrl+D
Start simulationCtrl+T
Stop simulationCtrl+Shift+T
Build model (for code generation)Ctrl+B

Debug Models

TaskShortcut
StepF10
Step inF11
Step outShift+F11
RunF5
Set or clear breakpointF12

See Also

|

Related Topics