How do I comment out a large block of code in MATLAB?
Mostrar comentarios más antiguos
I want to do this in an easy way.
3 comentarios
Carol Hurwitz
el 8 de Jul. de 2018
CTRL+R
Hamid Nourani
el 21 de Abr. de 2020
Great
Md.Al AMIN TALUKDER
el 26 de Jul. de 2020
ctrl+r
u can use both for single or multiple line.
Respuesta aceptada
Más respuestas (3)
CHUANQIANG ZHANG
el 10 de Mayo de 2018
15 votos
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 comentarios
Sainyam Gupta
el 15 de Jun. de 2023
you are making us fool bc
ctrl+t open new tab.....mf
Manik Sharma
el 15 de Jun. de 2023
Ctrl+t opens new tab bc.
Steven Lord
el 15 de Jun. de 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
el 30 de Mzo. de 2018
2 votos
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 comentario
THONTI BEERAIAH
el 18 de En. de 2023
Thank you, this is what I need.
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!