Indent a block of code
Ältere Kommentare anzeigen
How do you indent a block of code? For example if you enclose a block of code in an if statement, and want to indent said block.
Akzeptierte Antwort
Weitere Antworten (2)
Image Analyst
am 30 Okt. 2011
17 Stimmen
Highlight the lines of text. Then hit tab to indent them a level to the right, and shift-tab to outdent them a level to the left.
Rachel Allen
am 8 Jan. 2021
5 Stimmen
You can also use smart indent
select code then 'ctrl I'
or
select code -> right click -> Smart Indent
1 Kommentar
Image Analyst
am 8 Jan. 2021
I often just type control-a (to select all) and then control-i (to properly indent the entire file).
Kategorien
Mehr zu App Building finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!