How do I comment out a large block of code in MATLAB?
Mostra commenti meno recenti
I want to do this in an easy way.
3 Commenti
Carol Hurwitz
il 8 Lug 2018
CTRL+R
Hamid Nourani
il 21 Apr 2020
Great
Md.Al AMIN TALUKDER
il 26 Lug 2020
ctrl+r
u can use both for single or multiple line.
Risposta accettata
Più risposte (3)
CHUANQIANG ZHANG
il 10 Mag 2018
15 voti
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 Commenti
Sainyam Gupta
il 15 Giu 2023
you are making us fool bc
ctrl+t open new tab.....mf
Manik Sharma
il 15 Giu 2023
Ctrl+t opens new tab bc.
Steven Lord
il 15 Giu 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
il 30 Mar 2018
2 voti
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 Commento
THONTI BEERAIAH
il 18 Gen 2023
Thank you, this is what I need.
Categorie
Scopri di più su Entering Commands in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!