How do I comment out a large block of code in MATLAB?
이전 댓글 표시
I want to do this in an easy way.
댓글 수: 3
Carol Hurwitz
2018년 7월 8일
CTRL+R
Hamid Nourani
2020년 4월 21일
Great
Md.Al AMIN TALUKDER
2020년 7월 26일
ctrl+r
u can use both for single or multiple line.
채택된 답변
추가 답변 (3개)
CHUANQIANG ZHANG
2018년 5월 10일
15 개 추천
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
Sainyam Gupta
2023년 6월 15일
you are making us fool bc
ctrl+t open new tab.....mf
Manik Sharma
2023년 6월 15일
Ctrl+t opens new tab bc.
Steven Lord
2023년 6월 15일
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
2018년 3월 30일
2 개 추천
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
THONTI BEERAIAH
2023년 1월 18일
Thank you, this is what I need.
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!