How to use MATLAB editor more effectively

2 views (last 30 days)
Still new to some features of MATLAB. I notice this in the MATLAB editor window. On the left edge of the window when I enter some
code, especially for-next loops and if statements, there are lines connecting boxes. There are some horizontal dashes here and there, also.
Not clear what the dashes mean.
The boxes have + signs in them. I found out that by clicking these boxes, code contained in the relevant for-next is collapsed, which
is very helpful sometimes. Is any of this documented anywhere? What else can be done with this capability? I have been converting some legacy FORTRAN 77 "spaghetti" code to MATLAB, and the process is rather painful and slow. Converting FORTRAN if statements and GO TO statements to their MATLAB equivalents can be tricky. Perhaps knowing more about this MATLAB editor capability would help me speed up my conversion work? Are there other editor tools that would help understand the program flow of a MATLAB program?

Accepted Answer

Steven Lord
Steven Lord on 17 Aug 2022
What you're describing is the code folding functionality. See the "Fold Code" section on this documentation page for more information.

More Answers (0)

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!