To change the colors that MATLAB® uses for text and background in desktop tools follow these steps:
Note: The colors you specify also apply to the Import Wizard, but do not apply to the Help display pane or the Web browser.
On the Home tab, in the Environment section, click Preferences. Select MATLAB > Colors.
Clear Use system colors.
System colors are the text and background colors that your platform (for example, Microsoft® Windows®) uses for other applications.
Select the colors you want to use from the Text and Background color palettes.
When you choose a color, the Sample area in the dialog box updates to show you how it looks.
Tip If you use a gray background color, a selection in an inactive window is not visible.
Under Other colors, select the color you want to use for hyperlinks.
In the Command Window, Command History, Editor, and Shortcuts
callback area, MATLAB conveys syntax information using different
colors. This feature, known as syntax highlighting, helps you to identify
syntax elements, such as
if/else statements at
a glance. The Editor also provides syntax highlights colors for other
In the Command Window, only the MATLAB input you type is highlighted. The output from running MATLAB functions is not highlighted.
To change syntax highlighting colors, follow these steps:
On the Home tab, in the Environment section, click Preferences. Select MATLAB > Editor/Debugger > Language.
From the Language drop-down menu, select the language for which you want to change syntax highlighting colors.
In the Syntax highlighting section, select Enable syntax highlighting.
Change the colors.
If you set the Language to
click the Set syntax colors link, and then change
the colors under MATLAB syntax highlighting colors.
If you did not set the Language to
change the colors under Syntax highlighting .
Code Analyzer helps you to identify potential problems and refine your MATLAB code. By default, the Editor indicates:
Code for which there are warnings, by underlining that code with an orange wavy line and placing an orange line in the message bar.
Code for which there are errors, by underlining that code with an red wavy line and placing a red line in the message bar.
Code that MATLAB can fix automatically (autofix), by highlighting that code in tan.
To change code analyzer colors:
On the Home tab, in the Environment section, click Preferences. Select MATLAB > Colors > Programming Tools.
Under Code analyzer colors, select the colors you want for warnings, autofix highlighting, or both.
Decide if you want autofix highlights to appear in the Editor.
Clear Autofix highlight if you do not want autofix highlights to appear in the Editor; select Autofix highlight if you do.
Decide if you want to change the color that the code analyzer uses for errors.
If you do not, go to step 6.
If you do, then:
In the left navigation pane, click Colors.
Under MATLAB syntax highlighting colors, change the color for Errors.
In addition to changing the color of code analyzer indicators for errors, this action also changes the color for errors in the Command Window, Command History window, Editor, and Shortcuts callback area.
For more information, see Automatically Check Code in the Editor — Code Analyzer.