Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

Customizing the Desktop Using Preferences

Setting Keyboard 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.

Setting Tab Completion Preferences

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.

Setting Function Hints Preferences

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.

Setting Delimiter Matching Preferences

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.

Image of pop-up window in the Command Window showing a matching delimiter.

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:

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:

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:

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:

Setting Fonts Preferences for Desktop Tools

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:

See the following sections for details on setting fonts preferences:

Desktop Fonts Preferences

Use desktop font preferences to specify the font characteristics for MATLAB desktop tools. The font characteristics are

Select File > Preferences > Fonts to set fonts for desktop tools. You can specify:

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.

Image of Preferences dialog box, showing Fonts pane. Use the desktop code font and desktop text font to easily apply the same font to all tools that display code or text, respectively. Use Custom fonts to apply a font to the Help display pane and MATLAB Web browser.

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.

Image of Editor with three lines of text in 10 point Monospaced font.

Image of Editor with three lines of text in 10 point San Serif, a proportional font.

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

 Image of Monospaced font.

  • Command History

  • Command Window

  • Editor (which also applies to the Shortcuts Editor)

Desktop text font

Your system's current font.

  • Current Folder browser (which also applies to the Path browser)

  • Function Browser in the Command Window and Editor

  • Help Navigator

  • Workspace browser

  • Variable Editor

See Also.  

Specifying Options for MATLAB Using Preferences

Custom Fonts 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:

To specify custom fonts preferences:

  1. Select File > Preferences > Fonts > Custom.

    The Fonts Custom Preferences pane appears.

  2. 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.

  3. 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.

  4. Click OK.

Changing the Font — Example

This example:

  1. Select File > Preferences > Fonts.

  2. Under Desktop code font, select Times New Roman, Plain, 14 point.

  3. Under Desktop text font, select Use system font.

  4. Click Apply.

  5. Make the Command History window use the desktop text font:

    1. Click the Custom Fonts link.

    2. From Desktop tools, select Command History.

    3. Select the Desktop text radio button.

    4. Click Apply.

  6. Apply a custom font to the Current Folder browser:

    1. From Desktop tools, select Current Folder.

    2. Select the Custom radio button.

    3. Select Arial Narrow and Plain, and then type 11 in the size field.

    4. 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.

Antialiasing for Desktop Fonts on Linux and UNIX Platforms

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.

Making Fonts Available to MATLAB Tools on Windows Platforms

Under the following circumstances, consider updating fonts on your Windows platform as described:

For more information, refer to the Windows help.

Setting Colors Preferences for Desktop Tools

Setting Colors Used in Desktop Tools

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.

Image of Colors Preferences dialog box.

Desktop Tool Colors

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:

  1. Clear the Use system colors check box.

  2. 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.

  3. 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.

  4. Click Apply or OK to see the changes in the desktop tools.

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.

M-File Syntax Highlighting Colors

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.

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.

Image of sample area for colors preferences.

The default colors are listed here:

Click Restore Default Colors to return to the default settings for syntax highlighting colors and desktop tool colors.

Other Colors

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.

See Also

For information about other preferences and how MATLAB stores preferences, see Specifying Options for MATLAB Using Preferences.

Setting Toolbars Preferences for Desktop Tools

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:

  1. Select File > Preferences > Toolbars. You also can access Toolbars Preferences by right-clicking a toolbar and selecting Customize from the context menu.

  2. 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.

  3. 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.

  4. 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 Image of Move to End button.. The Demos button moves to the right end.

    • Add a separator bar after the selected control using this button: Image of the add separator bar button.. To remove a separator bar, select it, and then use the Remove button Image of 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.

  5. 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.

  


Recommended Products

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