How do I comment out a large block of code in MATLAB?
Ältere Kommentare anzeigen
I want to do this in an easy way.
3 Kommentare
Carol Hurwitz
am 8 Jul. 2018
CTRL+R
Hamid Nourani
am 21 Apr. 2020
Great
Md.Al AMIN TALUKDER
am 26 Jul. 2020
ctrl+r
u can use both for single or multiple line.
Akzeptierte Antwort
Weitere Antworten (3)
CHUANQIANG ZHANG
am 10 Mai 2018
15 Stimmen
Ctrl + R comment selected lines. Ctrl + T uncomment select lines.
https://stackoverflow.com/questions/30925796/is-there-a-shortcut-key-to-comment-multiple-lines-in-matlab-editor/30926004#30926004
3 Kommentare
Sainyam Gupta
am 15 Jun. 2023
you are making us fool bc
ctrl+t open new tab.....mf
Manik Sharma
am 15 Jun. 2023
Ctrl+t opens new tab bc.
Steven Lord
am 15 Jun. 2023
Search the list of keyboard shortcuts for the word "comment" or for the key combination Ctrl+T and you should see the actions associated with commenting out code or that will be performed in various components of the MATLAB Desktop in the keyboard shortcut set you've told MATLAB to use.
In my MATLAB installation using the Windows keyboard shortcut set, Ctrl+T creates a new tab in the Help Browser but uncomments code when used in the Editor.
Wesam Rezk
am 30 Mär. 2018
2 Stimmen
Simply start with *... and write whatever you want. This will enable you to write a very long comment line
For example *... This is a very very long comment
Rather than comment large sections of code, I bypass them with the following syntax.
for dont_go_here = []
% code I want to skip including all nested comments, etc. can stay here unmolested
end
This assumes that your if, for, case, try, and switch commands within that block are all terminated properly with an 'end' Otherwise the script won't parse.
1 Kommentar
THONTI BEERAIAH
am 18 Jan. 2023
Thank you, this is what I need.
Kategorien
Mehr zu Entering Commands 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!