
6 Editing and Debugging M-Files
To expand code for a construct that is currently collapsed, do one of the
following:
• Click the plus sign icon
to the left of the construct that you want to
expand.
• Place your cursor in the code that you want to expand, right-click, and then
select Code Folding > Expand from the context menu.
To collapse code for a construct that is currently expanded, do one of the
following:
• Click the minus sign icon
to the left of the construct that you want to
collapse.
• Place your cursor in the code that you want to collapse, right-click, and
then select Code Folding > Collapse from the context me nu.
To expand or collapse all of the code in an M-file, p lace your cursor anywhere
within the M-file, right-click, and then select Code Folding > Expand All or
Code Folding > Collapse All from the context me nu.
For information on the structure of an M-file, including a description of a
function definition line and an H1 line, see Basic Parts of an M-File in the
MATLAB Programming documentation
Viewing Folded Code in a Tooltip
You can view cod e that is currently folded b y positioning the pointer ove r its
ellipsis icon
. The code displays in a tooltip. This enables you to get a
quick view of the code without requiring you to unfold it.
Thefollowingimageshowsthetooltipthatdisplayswhenthepointeris
placed over the ellipsis icon on line 5 of collatzall.m when the collatzplot_new
function is folded.
6-36
Kommentare zu diesen Handbüchern