Main Content

Stateflow.resetSyntaxHighlightingColors

Reset Stateflow syntax highlighting to default colors

Since R2025a

Description

Stateflow.resetSyntaxHighlightingColors resets the Stateflow® syntax highlighting colors on all open models. For more information about syntax highlighting, see Default Syntax Highlighting.

This function does not disable the option Enable data syntax highlighting in the Syntax Highlight Preferences dialog box.

example

Examples

collapse all

This example shows how to reset the Stateflow syntax highlighting colors. Open the Stateflow chart shift_logic in the model sf_car.

Open the model sf_car.

open_system("sf_car")
  1. To open the shift_logic chart, right-click the chart and select Mask > Look Under Mask.

  2. In the Stateflow Editor, in the Format tab, click Style > Syntax Highlighting. The Syntax Highlight Preferences dialog box appears. In the Syntax Highlight Preferences dialog box, the Enable syntax highlighting option is on, but the Enable data syntax highlighting option is off.

  3. Select Enable data syntax highlighting.

  4. Choose an alternative from the color palette, and click Apply.

  5. To close the Syntax Highlight Preferences dialog box, click OK.

For this instance, red now indicates keywords, and pink indicates events.

To reset the syntax colors, in the MATLAB Command Window, enter:

Stateflow.resetSyntaxHighlightingColors

The chart now displays the default syntax highlighting colors.

Version History

Introduced in R2025a