| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
Setting Keyboard Preferences for Desktop Tools Setting Fonts Preferences for Desktop Tools |
Select File > Preferences > Keyboard to set the following preferences for the Command Window and Editor/Debugger:
See also Customizing Keyboard Shortcuts.
Enable in Command Window. Select the check box to use tab completion when typing functions in the Command Window—for more information about the feature, see Completing Statements in the Command Window — Tab Completion. Clear the check box if you do not want to use the tab completion feature. With the tab completion preference cleared, when you press the Tab key, MATLAB moves the cursor to the next tab stop rather than completing a function. See also the preference for Tab size.
Enable in Editor/Debugger. Select the check box to use tab completion when typing functions in the Editor—for more information about the feature, see Completing Statements in the Command Window — Tab Completion. Clear the check box if you do not want to use the tab completion feature. With the tab completion preference cleared, when you press the Tab key, MATLAB moves the cursor to the next tab stop rather than completing a function. For related information, select File > Preferences > Editor/Debugger > Tab, and click Help.
Tab key narrows completions. Select this check box to narrow the list of possible completions shown by typing another character and pressing Tab. For details, see Narrowing Completions Shown.
View Command Window tab key preferences. Click the link to set preferences for the Tab key size in the Command Window, which MATLAB uses when the tab completion preference is not enabled.
View Editor/Debugger tab key preferences. Click the link to set preferences for the Tab key size and indenting preferences in the Editor/Debugger.
To show function hints in the Command Window and Editor, select the function hints check boxes. If you do not want to use function hints, clear the check boxes. Function hints are a reminder of the syntax for a function that you use while entering a statement. The hints appear in a temporary pop-up window when you enter the opening parenthesis after a function name. For more information, see Viewing Function Syntax Hints While Entering a Statement.
To set these preferences, select File > Preferences > Keyboard. These preferences apply to the Command Window and the Editor.
With these preferences selected, MATLAB alerts you to matched and unmatched delimiters based on the MATLAB language syntax rules. For example, when you type a parenthesis or another delimiter, MATLAB highlights the matched parenthesis or delimiter in the pair.
Delimiter pairs are parentheses ( ), brackets [ ], and braces { }. For the Editor, paired language keywords are also matched. Paired language keywords include for, if, while, else, and end statements.
In the following illustration, MATLAB underlines the left parenthesis in the pair when you move over the right parenthesis using an arrow key.
![]()
If the matching delimiter is not visible on the screen, a pop-up window appears and shows the line containing the matching delimiter. In the Editor, the line number is included. Click in the pop-up window to go to that line.

Match while typing. Select the check box if you want to be alerted to matches and mismatches in pairs of delimiters as you type them. Then choose how you want MATLAB to alert you to matches by selecting an entry from Show match with. When you type a closing (or opening) delimiter in the Command Window or Editor, MATLAB alerts you based on the option you choose:
Balance — The corresponding delimiter is highlighted briefly.
Underline — Both delimiters in the pair are underlined briefly.
Highlight — Both delimiters in the pair are highlighted briefly.
Choose how you want MATLAB to alert you to mismatches using Show mismatch with. When you type a closing delimiter that does not have an opening match, MATLAB alerts you based on the option you choose:
Beep — MATLAB beeps.
Strikethrough — The delimiter you typed is crossed out briefly.
None — There is no action.
Match on arrow key. Select the check box if you want to be alerted to matches and mismatches in pairs of delimiters when you use an arrow key to move the cursor over a delimiter. Then choose how you want MATLAB to alert you to matches by selecting an entry from Show match with. When you move the arrow over a closing (or opening) delimiter in the Command Window or Editor, MATLAB alerts you based on the option you choose:
Underline — Both delimiters in the pair are underlined briefly.
Highlight — Both delimiters in the pair are highlighted briefly.
Choose how you want MATLAB to alert you to mismatches by selecting an entry from Show mismatch with. When you move an arrow key over a delimiter that does not have a match, MATLAB alerts you based on the option you choose:
Beep — MATLAB beeps.
Strikethrough — The delimiter is briefly crossed out.
None — There is no alert.
You can specify your preferences for fonts that the desktop tools use. The first time MATLAB uses or displays the list of available fonts, it gets the operating system's font list. If a font exists, but MATLAB cannot display it, then MATLAB excludes it from its list. The system fonts are installed in one of the following locations:
The operating system's standard location
Ask your system administrator where this is on your system.
The /jre/lib/fonts folder where Java software is installed on your system.
See the following sections for details on setting fonts preferences:
Use desktop font preferences to specify the font characteristics for MATLAB desktop tools. The font characteristics are
Name (also called family or type), for example, select SansSerif
Style, for example, select bold
Size in points, for example, type 11 points
Select File > Preferences > Fonts to set fonts for desktop tools. You can specify:
A font for all the tools that primarily display code, such as the Command Window
A font for all the tools that display text, such as the Current Folder
Custom fonts, including a font for all the tools that use HTML Proportional text, such as the Help display pane and the MATLAB Web browser
If you want, you can separately specify the font for each desktop tool.
Select the font characteristics from the lists shown. For font size, you can type or select a size. You can type a size not shown as a choice in the drop-down menu.
You can set some font options differently for printing — see Printing and Page Setup Options for Desktop Tools.
For information about making additional fonts available to MATLAB, see Making Fonts Available to MATLAB Tools on Windows Platforms.

Desktop Code Font and Desktop Text Font. You specify separate font characteristics for tools that primarily display code (Desktop code font), such as the Command Window, and tools that primarily display text (Desktop text font), such as the Current Folder browser. (For other tools, such as the Help display pane and the MATLAB Web Browser you use custom fonts—see Custom Fonts Preferences.)
Many users prefer that code display in a monospace font to provide better alignment, and to distinguish it from other text information. With the desktop code font preference, you set just one preference to apply a monospace style to all tools that display code (except the Help and Web Browsers).
Typically, users specify a proportional font for tools that display little or no code. You use the desktop text font preference to set just one preference that applies to all tools that display little or no code. If you want to use the system font as the desktop text font, select Use system font.
The following illustrations show how the Editor looks using a monospace font compared to a proportional font. A monospace font is useful when you care about alignment, while a proportional font uses less space.


When you change a font characteristic for Desktop code font, the characteristic takes effect for all tools that use the desktop code font. The same is true when you change a font characteristic for Desktop text font.
After changing a font characteristic, a sample in the dialog box shows how it will look. Click Apply or OK to make the change take effect in the desktop tools.
Factory Default Font Settings.The following table lists the factory default code and text font settings, and the tools that use those font settings. If you have made changes but want to revert to the default font characteristics, make changes using the values in the table.
Font Type | Factory Default Characteristics and Sample | Tools Using Font Type by Factory Default |
|---|---|---|
Desktop code font | Monospaced, Plain, 10 point
|
|
Desktop text font | Your system's current font. |
|
Specifying Options for MATLAB Using Preferences
Use custom font preferences to specify the font for HTML Proportional Text, and to override font settings for individual desktop tools. Desktop tools otherwise use the settings that the Fonts pane specifies. The Fonts pane is described in Desktop Fonts Preferences.
HTML Proportional Text is the default font for the following tools and portions of tools:
The MATLAB Help display pane
The small window that opens for the help on selection feature.
The MATLAB Web browser— which displays the HTML output generated from publishing
The Profiler
The Function Browser function help
Extended M-Lint messages
To specify custom fonts preferences:
Select File > Preferences > Fonts > Custom.
The Fonts Custom Preferences pane appears.
Select the tool for which you want to specify custom fonts from the Desktop tools list. The type of font the tool currently uses appears under Font to Use.
For Font to Use, select one of the following:
Desktop code, which you can customize using the Fonts pane.
Desktop text, which you can customize using the Fonts pane.
Custom, and then specify the font characteristics.
Click OK.
Note If you change the font style (for example, to bold or italic) for HTML Proportional Text, it has no effect. If you change the font size, it affects both noncode and code text for tools using the HTML Proportional Text font. |
This example:
Changes the settings for the desktop code font from the factory default settings. (See Factory Default Font Settings.)
Changes the Command History font preference so that it uses the desktop text font instead of the code font.
Specifies a custom font for the Current Folder browser.
Select File > Preferences > Fonts.
Under Desktop code font, select Times New Roman, Plain, 14 point.
Under Desktop text font, select Use system font.
Click Apply.
Make the Command History window use the desktop text font:
Click the Custom Fonts link.
From Desktop tools, select Command History.
Select the Desktop text radio button.
Click Apply.
Apply a custom font to the Current Folder browser:
From Desktop tools, select Current Folder.
Select the Custom radio button.
Select Arial Narrow and Plain, and then type 11 in the size field.
Click OK.
The following table details the results of the changes.
Tool | Font Type | Font Characteristics |
|---|---|---|
Command Window | Desktop code | Times New Roman® font, Plain, 14 point |
Command History | Desktop text | Same as your current system font, which appears in the dimmed fields below the Use system font check box. |
Editor | Desktop code | Times New Roman font, Plain, 14 point |
Help Navigator | Custom | SanSerif, Plain, 8 point |
HTML Proportional Text | Custom | SansSerif, Plain, 10 point |
Current Folder browser | Custom | Monotype Corporation Arial® Narrow font, Plain, 11 point |
Workspace browser | Desktop text | Same as your current system font, which appears in the dimmed fields below the Use system font check box. |
Variable Editor | Desktop text | Same as your current system font, which appears in the dimmed fields below the Use system font check box. |
Function Browser | Desktop text | Same as your current system font, which appears in the dimmed fields below the Use system font check box. |
Notice that on the Fonts preferences pane, the descriptive text reflects your changes. For example, under Desktop text font, the text reads, Currently used by: Command History, Workspace, Variable Editor, Function Browser.
See Also. For information about how MATLAB stores preferences, and to get help for other preferences, see Specifying Options for MATLAB Using Preferences.
To give the desktop a smoother appearance on Linux[1] and UNIX[2] platforms, select the antialiasing preference on the Preference > Fonts pane. The preference applies to all fonts.
Note The antialiasing option is not necessary on Microsoft Windows or Apple Macintosh platforms, because MATLAB follows the operating system's font settings on these platforms. |
Under the following circumstances, consider updating fonts on your Windows platform as described:
If a new compatible font is available to MATLAB
A compatible font on Windows platforms for desktop components (such as the Command Window), figure windows, and uicontrols is one compatible with TrueType® and Microsoft OpenType® fonts. A compatible font for graphics objects, such as xlabel, ylabel, title, and text is a bitmapped font.
Use the Windows Control Panel to install the font. Then, restart MATLAB so that it can use the font.
If you open a file created by someone else, and you see boxes or meaningless symbols instead of text.
When you see boxes or meaningless symbols instead of text, it is probably because you are using different language fonts from the file creator. This situation can occur, for example, if you open a file created by someone whose native language is Japanese and your native language is English. The Japanese user is probably using fonts for East Asian languages and you are not.
In the Windows Control Panel, find the region and language options, and then install the supplemental files for East Asian languages.
For more information, refer to the Windows help.
Desktop color preferences specify the colors used in MATLAB desktop tools and the colors that convey syntax highlighting. Select File > Preferences > Colors to set color preferences for desktop tools. You can set some color options differently for printing — see Printing and Page Setup Options for Desktop Tools.

Use Desktop tool colors to change the color of the text and background in the desktop tools. The colors also apply to the Import Wizard. The colors do not apply to the HTML display pane nor to the Web Browser.
Select the check box Use system colors if you want the desktop to use the same text and background colors that your platform (for example, Microsoft Windows) uses for other applications.
To specify different text and background colors, follow these steps:
Click the arrow next to the Text color and choose a new color from the palette shown.
When you choose a color, the Sample area in the dialog box updates to show you how it will look.
Click the arrow next to the Background color and choose a new color.
If you use a gray background color, a selection in an inactive window will not be visible.
Click Restore Default Colors to return to the default settings for desktop tool colors, as well as for syntax highlighting colors.
Gray Background Color. For some UNIX[3] platforms, there is a gray background color for desktop tools, such as the Editor. This occurs when the preference for Desktop tool colors is set to Use system colors, and the system's window manager uses gray as the background color default. To change the color, clear the check box for Use system colors and then select a new Background color from the palette.
In the Command Window, Command History, Editor, and Shortcuts callback area, MATLAB conveys syntax information via different colors to help you easily identify elements, such as if/else statements. This is known as syntax highlighting.
In the Command Window, only the input you type is highlighted; the output from running MATLAB functions is not highlighted.
Note To set syntax highlighting colors for files you create for the TLC, C, C++, or Sun Microsystems Java languages, or for HTML, and XML, use the Editor/Debugger language preferences. Select File > Preferences > Editor/Debugger > Language. Click the Help button to get information on Setting Language Preferences in the online documentation. |
When you choose a color under the M-file syntax highlighting colors area, the Sample area in the dialog box updates to show you how it will look.

The default colors are listed here:
Keywords — Flow control functions, such as for and if, as well as the continuation ellipsis (...), are blue.
Comments — All lines beginning with a %, designating the lines as comments in MATLAB, are green. Similarly, the block comment symbols, %{ and %}, as well as the code in between, appear in green. Text following the continuation ellipsis on a line is also green because it is a comment.
Strings — Type a string and it is maroon. When you complete the string with the closing quotation mark ('), it becomes purple. Note that for functions you enter using command syntax instead of function syntax, the arguments are highlighted as strings. This is to alert you that in command notation, variables are passed as literal strings rather than as their values. For more information, see MATLAB Command Syntax in the MATLAB Programming Fundamentals documentation.
Unterminated strings — A single quote without a matching single quote, and whatever follows the quote, are maroon. This might alert you to a possible error.
System commands — Commands such as ! (shell escape) are gold.
Errors — Error text that appears after you run code, including any hyperlinks, is red.
Click Restore Default Colors to return to the default settings for syntax highlighting colors and desktop tool colors.
Note Syntax highlighting for M-files is enabled by default. If you find it is disabled, follow these steps to reenable it:
|
Specify the color for Hyperlinks, which applies to links in the Command Window. If you use a dark background color for the Command Window, be sure to use a light or other contrasting color for hyperlinks so that you can see them.
With the M-Lint autofix highlight preference selected, code that M-Lint can automatically correct is highlighted in the Editor. Use the palette to change the highlight color. For more information, see Using M-Lint Automatic Code Analyzer in the Editor.
For information about other preferences and how MATLAB stores preferences, see Specifying Options for MATLAB Using Preferences.
You can customize some toolbars in the MATLAB application using Toolbars preferences. You can add and remove buttons and other controls, as well as change their position on the toolbar.
To access Toolbars preferences, select File > Preferences and select Toolbars.
The following figure summarizes how to modify toolbars.

Following is an example of a customized MATLAB desktop toolbar.

To customize a toolbar, follow these steps:
Select File > Preferences > Toolbars. You also can access Toolbars Preferences by right-clicking a toolbar and selecting Customize from the context menu.
In the resulting Toolbars preferences pane, choose the toolbar to modify by selecting it from the Toolbar list:
MATLAB — the toolbar in the MATLAB desktop
Editor — the toolbar in the MATLAB Editor
Editor Cell Mode — a specialized toolbar in the Editor. For more information, see Using Cells for Rapid Code Iteration and Publishing Results.
Workspace, the toolbar in the Workspace browser
Current Folder, the toolbar in the Current Folder browser
The controls for the selected toolbar appear in the Layout and Controls sections of the Toolbars Preferences pane.
Customizing controls:
To add controls — choose a control to add to the toolbar by selecting its check box in the Controls section of the dialog box. For example, select the Demos check box to add its button to the toolbar.
To remove controls — choose a control to remove from the selected toolbar by clearing its check box in the Controls section of the dialog box. For example, to remove the Cut, Copy, and Paste toolbar buttons, clear the check box for each.
Restoring defaults — if you want to show the controls that appeared on the selected toolbar and in the same order as when MATLAB was first installed, click Restore Factory Controls.
The Layout section of the dialog box displays the controls you chose for the toolbar, in the order they will appear.
Rearrange the order of the controls and separator bars on the selected toolbar using the Layout area:
Drag a control or separator bar to another position.
Select a control or separator bar; then use one of
the move buttons. For example, select the Demos button
, and then the Move to the End button
. The Demos button moves to the right
end.
Add a separator bar after the selected control using
this button:
. To remove a separator bar, select
it, and then use the Remove button
. You can use the Remove button to delete
any control selected in the Layout section of
the dialog box.
The Layout area displays the controls in the order you specified.
Click Apply or OK. The toolbars in the desktop and Editor update to reflect the changes you made.
For information about hiding, showing, and moving toolbars, see Using Toolbar Features.
[1] Linux is a registered trademark of Linus Torvalds.
[2] UNIX is a registered trademark of The Open Group in the United States and other countries.
[3] UNIX is a registered trademark of The Open Group in the United States and other countries.
![]() | Setting General Preferences for the MATLAB Application | Accessibility | ![]() |

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 |