| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
A keyboard shortcut is a means of using keyboard key strokes to perform a desktop action, without opening a desktop menu. If a keyboard shortcut is available for a menu option, it appears to the right of the option name on the menu. For example, the default keyboard shortcut for opening the Open dialog box is Ctrl+O.

It is possible to have multiple keyboard shortcuts for an action. All defined shortcuts work, but only one appears next to the option name on the desktop menu. When you provide a keyboard shortcut for a menu option that previously had none, the desktop menu automatically updates to display the keyboard shortcut.
If you define a keyboard shortcut that uses the same keystrokes as a mnemonic but performs a different action, then the mnemonic no longer works.
You can choose from a set of shortcuts that install with MATLAB, create custom shortcut sets, or use shortcut sets copied from other users or systems. For more information see Performing Desktop Actions Using the Keyboard
You choose a set of keyboard shortcuts to use from the Active settings drop-down list in the Keyboard Shortcuts preferences dialog box. By default, MATLAB uses a settings file that corresponds to the platform on which you are running. Use the default keyboard shortcuts set or use a different set to:
Modify keyboard shortcuts. See Steps for Customizing Keyboard Shortcuts.
Create a new settings file. See Saving Keyboard Shortcuts to a Settings File.
Use a settings file that does not install with MATLAB. See Using Keyboard Shortcuts Settings Files Created on Other Systems.
To choose a keyboard shortcuts settings file, follow these steps:
Open the Keyboard Shortcuts Preferences dialog box by choosing File > Preferences > Keyboard > Shortcuts.
Click the down arrow in the Active settings field, and then choose a settings file that you want to use.
If a file that you want to use is on your system, but does not appear in the drop-down list, click Browse to find it.
Click Apply.
The following table lists the keyboard shortcuts settings files installed with MATLAB.
| Operating System | Keyboard shortcut settings files installed with MATLAB |
|---|---|
| Windows |
|
| UNIX |
|
| Macintosh |
|
To determine the current keyboard shortcut for an action, view one of the following:
Open the menu to see if the keyboard shortcut appears next to the menu option.
For example, suppose you want to determine the keyboard shortcut for decreasing the indent in the Editor. Open the Text menu, and then view the keyboard shortcut for Decrease Indent. The keyboard shortcut Ctrl+[ appears to the right of the option.

If no keyboard shortcut appears on the menu, one does not currently exist for that action. To create a keyboard shortcut for an action, follow the steps in Customizing Keyboard Shortcuts.
To identify a keyboard shortcut when there is no menu option for an action, use the Keyboard Shortcuts Preferences pane:
Choose File > Preferences > Keyboard > Shortcuts.
In the filter field, type the name of the tool for which you want to list the keyboard shortcuts. For example, type Editor to see the keyboard shortcuts currently defined for actions you can perform in the Editor.

Narrow the list of Action names that the preferences pane displays by typing a string describing the action. For example, type clear, if you want to find the keyboard shortcut for clearing selected text in the Editor. Type a short string to increase the likelihood of the filter returning the action you seek.

View the table that appears in the middle of the Keyboard Shortcuts Preferences pane. For example, this table indicates that the Escape key is the current keyboard shortcut for the Clear Selection action in the Editor.

To customize or view keyboard shortcuts for MATLAB desktop tools, choose File > Preferences > Keyboard > Shortcuts. If you have an active Internet connection, you can watch the Customizable Keyboard Shortcuts video for an overview.
The following sections provide details:
Choose File > Preferences > Keyboard > Shortcuts.
In the Active settings field, choose the file that contains the set of keyboard shortcuts that you want to customize.
Typically, the first time you modify keyboard shortcuts, you begin with the default settings for your platform. For details, see Choosing a Set of Keyboard Shortcuts.
Under Action name, select the action for which you want to define or modify a keyboard shortcut. An action is the operation for which you want to customize the shortcut, such as Clear Command History.
For tips on finding the action you want, see Filtering Keyboard Shortcut Actions.
Click the Add button
.
An editable field opens under the Shortcut column.

Type the shortcut that you want to use for the action you selected in Step 3. Alternatively, you can choose a shortcut from the drop-down menu.
For details, see Specifying Keystrokes for a Keyboard Shortcut.
Assign the shortcut to the tool or tools with which you want to use it. For example, in the Tools with shortcut column:
Click the down arrow
for the list of desktop
tools to which you can assign a shortcut. Not all actions are available
with all desktop tools.
Select a check box to assign the shortcut to a tool. Clear a check box to remove it.

Evaluate and resolve conflicts, indicated by the informational
and error
icons, if necessary.
For more information, see Evaluating and Resolving Keyboard Shortcut Conflicts.
Click Apply.
The keyboard shortcut becomes available immediately.
If you changed a shortcut that corresponds to a menu option that previously did not display a keyboard shortcut, MATLAB reflects the new keyboard shortcut in the menu.
If you modify keyboard shortcuts, and then decide you do not want to keep the changes, click Restore defaults. Be aware that clicking Restore defaults reverts all keyboard shortcuts changes you have made since you last saved the set. If you modify keyboard shortcuts in a set that installs with MATLAB, such as Windows Default, you lose all previous modifications. You cannot revert changes on a shortcut-by-shortcut basis.
The following image shows the Active settings field displaying a modified Windows Default set of keyboard shortcuts and the Restore defaults button.

Save a settings file to:
Save changes you make to a default settings file, such as the Windows default set, to a new set.
Although changes you make to the default sets are preserved across MATLAB sessions, you lose all changes if you click the Restore defaults button and you have not previously saved the to a new set.
Copy it to another system running MATLABand use it there.
Overwrite a file that you previously saved.
You cannot overwrite the default settings files that install with MATLAB. MATLAB saves modifications that you make to a default set using the name of the default set appended with the text (modified). For instance, Windows default (modified).
Share it with others.
For information on sharing your active settings file with the MATLAB community, see Submitting Your Files to the Repository.
To save a keyboard shortcuts settings file, follow these steps:
Open the Keyboard Shortcuts Preferences dialog box by choosing File > Preferences > Keyboard > Shortcuts.
Click the Save As button.
Navigate to the folder in which you want to save the file, specify the file name, and then click Save.
MATLAB saves the file as an .xml file in the folder that the Command Window returns when you type prefdir.
Use the filter field to see the list of actions for which you can customize or define a keyboard shortcut as follows:
Type all or part of any one of the following:
An action name, for example, Delete.
MATLAB displays only the action names or desktop menus that contain the text you specify.
The name of a desktop tool or menu, for example, File or Command Window.
MATLAB displays the action names associated with the tool or menu you specify. In addition, the list of action names includes any action names that contain the name of the tool or menu. For example, if you specify Command History, the list of action names includes Next History Command, which is a Command Window action.
A keyboard shortcut, for example, Ctrl+R
MATLAB displays only the action names that have the shortcut you specify. Be aware of the following:
You can enter most keyboard shortcuts by either pressing the keystrokes or typing the key names.
To specify Ctrl+S, for example, you can type Ctrl+S character-by-character, or you can press the keyboard shortcut, Ctrl+S.
If pressing the keystrokes for a keyboard shortcut does not work, try typing it instead. Some examples of keyboard shortcuts you must type character-by-character are Tab, Backspace, and Delete.
Use NumPad to refer to the number pad that is on the far right of some keyboards.
Use Up and Down to refer to the Up arrow and Down arrow keypad keys.
Verify that an Action name performs the action you expect:
Hover the mouse pointer over the Action name. For example, Remove Next Word.
View the tooltip that appears.

Specify the keystrokes for a keyboard shortcut as follows:
Click the Add button
Specify the number of keystrokes you want to use for the shortcut.
To use the default, which is one keystroke, skip to step 3.
To specify multiple keystrokes, or to specify explicitly one keystroke follow these steps:
Click the down arrow next to the key icon
in the Shortcuts field.
Choose Limit to 1 keystroke, Limit to 2 keystrokes, or Limit to 3 keystrokes.
For instance, Ctrl+F is one keystroke, Ctrl+Y, Shift+Z is two keystrokes, and Ctrl+Y, Shift+Z, F9 is three keystrokes.
Specify the keystrokes, by doing one of the following:
Type the keystrokes, by pressing the keys, not spelling the key names.
For example, press the Ctrl key and the Y key. Do not type C-t-r-l-+-Y.
Choose a keystroke such as the Tab key,
by clicking the down arrow next to the key icon
in the Shortcuts field.
Then, choose the key name.
The listed keys are those keys that already have a defined action within a dialog box. For example the Tab key navigates from one field to the next in a dialog box.
Conflicts arise when the same shortcut is assigned to two or more different actions. There is no requirement that you resolve keyboard shortcut conflicts. However, if the same shortcut specifies two different actions, the shortcuts can be confusing to use.
View keyboard shortcut conflicts by choosing File > Preferences > Keyboard > Shortcuts.
The Keyboard Shortcuts preferences pane indicates conflicts
using informational
and error
icons.
—An informational icon indicates
that two different actions in two different tools have the same shortcut.
For information on resolving these conflicts, see Actions in Different Tools Have the Same Shortcut —
Evaluating Conflicts.
—An error icon indicates that
two different actions within the same tool have the same shortcut.
For information on resolving these conflicts, see Actions in the Same Tool Have the Same Shortcut — Evaluating
Conflicts.
Typically, you want to resolve conflicts indicated by the informational
icon
when all the following are true:
You use both tools frequently.
You perform both actions frequently.
You have difficulty remembering the action that the shortcut performs in each tool.
For instance on Microsoft Windows platforms, by default, Ctrl+Shift+U undocks a tool from the MATLAB desktop. However if you select text in the Editor, and then press Ctrl+Shift+U, it changes the selected text to uppercase. If you frequently use both of these actions, you can specify a different keyboard shortcut for one or both actions.
Typically, you want to resolve conflicts indicated by the error
icon
.
It can be unnecessary to resolve these conflicts if one or more of the following are true:
The situation is temporary
For instance, you are performing a two-step procedure. In the first step, you assign the keyboard shortcut to an action that results in a conflict. Then, in the second step, you remove the shortcut from the original action.
The two actions are associated with different modes of the same tool.
By default, when the MATLAB Editor is in cell mode, Ctrl+Up and Ctrl+Down move the cursor to the Next and Previous cell, respectively. When the Editor is not in cell mode, those keyboard shortcuts scroll up and scroll down, respectively. The shortcuts are in conflict, but the behavior probably is expected, for the given MATLAB Editor mode.
Similarly, although not evident from the preferences pane, on Windows systems, the keyboard shortcut for interrupting MATLAB execution is Ctrl+C. However, the default keyboard shortcut for the copy action is also Ctrl+C. Under these conditions, if you:
Select an item, and then press Ctrl+C, it copies the selected item to the clipboard, — regardless of whether MATLAB is busy
Do not select an item and press Ctrl+C, it interrupts MATLAB execution
If you change the default keyboard shortcut for the copy action from Ctrl+C to another keystroke, then Ctrl+C interrupts MATLAB execution, regardless of whether you have selected an item.
To resolve a conflict, change or delete shortcuts such that there is a one-to-one correspondence between a shortcut and a frequently used action. For examples, see Changing a Keyboard Shortcut and Deleting a Keyboard Shortcut.
By default, no keyboard shortcut is available for adding a Help topic to the list of favorites. If you frequently mark topics as favorites, you can define a keyboard shortcut for this action, as follows:
Choose File > Preferences > Keyboard > Shortcuts.
In the filter field, type Help.
Scroll through the Action name list, and select Add to Favorites.
Click the plus button
![]()
MATLAB adds a row to the table above the plus button.
In the Shortcut field, click the down arrow, and then change Limit to 1 keystroke to Limit to 2 keystrokes.
In the Shortcut field, press Ctrl+S, and then Alt+V.
Notice that the All Possible Conflicts table is empty, which indicates that no other desktop action is currently using this combination of keystrokes.
Click Apply.
Notice that:
The Add to Favorites dialog box opens when you press Ctrl+S, Alt+V in the Help browser.
Ctrl+S, Alt+V appears next to Add to Favorites when you click the Favorites menu in the Help browser.
Suppose you frequently adjust indenting in the MATLAB Editor. However, you have difficulty remembering the default keyboard shortcut of Ctrl+[ for decreasing the indent. So, you decide to change it to something that is easier to remember.
This example changes the keyboard shortcut for Decrease Indent in the MATLAB Editor from Ctrl+[ to Ctrl+Backspace:.
Choose File > Preferences > Keyboard > Shortcuts.
Under Active settings, choose Windows Default Set.
In the filter field, press Ctrl+[.
Under Action name, Decrease Indent displays in shading.

In the table labelled Click in the table below to edit shortcuts for Decrease Indent, under Shortcut, click Ctrl+[. MATLAB makes the field editable.

In the Shortcut field, press Ctrl+Backspace.
Click Apply.
MATLAB saves your changes to the Windows Default Set (modified) settings.
Suppose you find yourself frequently pressing the wrong keyboard shortcut. For example, you press Alt+Enter (apply M-Lint autofix) instead of Ctrl+Enter (evaluate the current cell in the MATLAB Editor ). To avoid accidentally applying an M-Lint autofix, you decide to delete the Alt+Enter shortcut. Follow these steps:
Choose File > Preferences > Keyboard > Shortcuts.
Under Active settings, choose Windows Default Set or Windows Default Set (modified).
In the filter field, press Alt+Enter.
Under Action name, select the row containing Autofix M-Lint.
In the next table, under Shortcut, select the row containing Alt+Enter.

Click the remove button
.
Click Apply.
If it does not exist, MATLAB creates a Windows Default Set (modified) keyboard shortcut set. This set consists of the Windows Default Set of keyboard shortcuts, less the shortcut for Alt+Enter. If the Windows Default Set (modified) settings file exists, then MATLAB deletes the Alt+Enter keyboard shortcut from that set of keyboard shortcuts.
If you find a keyboard shortcuts settings file that is useful to you, or if you want to use one you created on a different system, make it the active keyboard shortcuts settings file as follows:
Copy the settings file to a folder on your system, such as:
I:\my_matlab_files\active_settings_files\new_settings.xml
Choose File > Preferences > Keyboard > Shortcuts.
In the Active settings field, click the down arrow, and then click Browse.
In the Open dialog box, navigate to the folder where you copied the settings file.
Select the settings file, and then click Open.
In the Keyboard Shortcuts preferences pane, click Apply. The settings file you specified is now the active settings file for MATLAB.
Consider using File Exchange to share your active settings file with others, or to find a file that is useful to you. For more information on File Exchange, see File Exchange — Finding and Getting Files Created by Other Users.
These sections describe the tools, portions of tools, and actions for which you cannot change keyboard shortcuts:
You cannot change the keyboard shortcuts associated with the following tools or portions of tools:
Figure windows—For example, you cannot modify the keyboard shortcut, Ctrl+S, for saving a MATLAB .fig file.
Toolboxes—For example, you cannot modify keyboard shortcuts in the SimBiology® desktop.
Incremental search—You can modify the keyboard shortcuts for initiating a forward or backward incremental search. However, you cannot change the keyboard shortcuts that you use within incremental search mode, such as Ctrl+Shift+S to search forward.
Dialog boxes—For example, you cannot create a keyboard shortcut for the OK button.
The following table describes some frequently used actions for which you cannot customize keyboard shortcuts.
Action | Keyboard Shortcut |
|---|---|
Cancel the current action. | Esc (escape) For example, if you select the Edit menu, the menu items display. Pressing Esc retracts the menu items. In the Function Browser, pressing Esc up to three times has the following effects:
|
Interrupt MATLAB execution on all supported platforms. | Ctrl+C |
Interrupt MATLAB execution on Windows and UNIX systems. | Ctrl+Cancel |
Interrupt MATLAB execution on Macintosh systems. | Cmd+. (period) |
Open context menu on Windows and UNIX systems. | Ctrl+Shift+F10 |
Close the desktop and consequently shut down the MATLAB program. Outside the desktop, close the active window (except on Macintosh platforms). | Alt+F4 |
Accessibility affordances | Tab for navigating through fields in dialog boxes, for example. |
Make an open tool the active tool | These shortcuts appear on the desktop Windows menu.
They are:
|
![]() | Performing Desktop Actions Using the Keyboard | Accessing Tools with the Start Button | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |