To comment out a large block of code in the Editor or Live Editor, select the code and on the "Editor" or "Live Editor" tab, click the "Comment" button. This inserts a "%" symbol in front of each selected line. Alternatively, select the code and type "Ctrl" + "R". To uncomment the selected text, click the "Uncomment" button or type "Ctrl" + "T".
You also can use the block comment operators "%{" and "%}". The "%{" and "%}" operators must appear alone on the lines that immediately precede and follow the block of help text. For example:
%{
Stuff to be commented out
%}
3 Comments
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/122-how-do-i-comment-out-a-large-block-of-code-in-matlab#comment_587082
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/122-how-do-i-comment-out-a-large-block-of-code-in-matlab#comment_587082
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/122-how-do-i-comment-out-a-large-block-of-code-in-matlab#comment_832311
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/122-how-do-i-comment-out-a-large-block-of-code-in-matlab#comment_832311
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/122-how-do-i-comment-out-a-large-block-of-code-in-matlab#comment_950302
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/122-how-do-i-comment-out-a-large-block-of-code-in-matlab#comment_950302
Sign in to comment.