MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Right-Side Text Limit Indicator


By default, a light gray vertical line (rule) appears at column 75 in the Editor, indicating
where a line exceeds 75 characters. You can set this text limit indicator to another value,
which is useful, for example, if you want to view the code in another text editor that has a
different line width limit. The right-side text limit indicator is not supported in the Live
Editor or in MATLAB Online.

To hide, or change the appearance of the vertical line:

1
On the Home tab, in the Environment section, click Preferences.

The Preferences dialog box opens.

(^2) Select MATLAB > Editor/Debugger > Display.
(^3) Adjust the settings in the Right-hand text limit section.
NoteThis limit is a visual cue only and does not prevent text from exceeding the limit. To
wrap comment text at a specified column number automatically, adjust the settings in the
Comment formatting section under MATLAB > Editor/Debugger > Language in the
Preferences dialog box.
Code Folding — Expand and Collapse Code Constructs
Code folding is the ability to expand and collapse certain MATLAB programming
constructs. This improves readability when a file contains numerous functions or other
blocks of code that you want to hide when you are not currently working with that part of
the file. MATLAB programming constructs include:



  • Code sections for running and publishing code

  • Class code

  • for and parfor blocks

  • Function and class help

  • Function code


To see the entire list of constructs, select Editor/Debugger > Code Folding in the
Preferences dialog box.

24 Coding and Productivity Tips

Free download pdf