How can I comment a group of lines without commenting each line?
ie like \'c\'
/*
printf(\"hello\");
printf(\"there\");
*/
in Matla
Or just select group of lines you want to comment then use keystroke 'Ctrl+/(forward slash)' and voila, it will comment the selected block's each line with % as one would do individually. To undo I tried but don't know what key stroke can work, so anyone please...
Select all lines then do:
for comment:
from Text menu-->comment
for uncomment:
from Text menu-->uncomment
You can use keyboard shortcuts:
To comment multiple lines: CTRL + r
To uncomment multiple lines: CTRL + t
It works perfect in Matlab 2016.
Can I comment a block of lines in an MATLAB file using /* ... */ as I can in C?:
%{
...
Block of COMMENTS HERE
...
...
%}
%CODE GOES HERE
plot(1:10)
1) MATLAB v7+:
%{
...code to be commented
%}
2) Use the editor:
select all the lines, then choose toggle comment or something in the menu. it's there