Is there a shortcut key to comment multiple lines in matlab editor
17,724
Solution 1
The comment shortcut is CTRL+R on Windows and CTRL+/ on Unix systems (not sure about OS X). To comment multiple lines you'd have to highlight them using the mouse or SHIFT.
In any case this can be customized via Preferences -> Keyboard -> Shortcuts.
Solution 2
In Octave, Ctrl+R to comment and Ctrl+Shift+R to un-comment.
Solution 3
In Mac OS, Command + R to comment code.
Then, Shift+Command+R to un-comment.
Author by
Saeid
Updated on June 04, 2022Comments
-
Saeid almost 2 years
Is there a shortcut to comment multiple lines in matlab. If there isn't can I create one?
-
Setsu almost 9 yearsWhat OS are you working on? Some shortcuts differ slightly between systems.
-
user8473076 over 6 years...& Ctrl+T to un-comment.
-
The_Black_Smurf over 6 yearsOP was looking for a way to comment multiple lines... not how to uncomment. I think your shortcut may still be relevant as a comment.
-
-
Hoki almost 9 yearsto add a little bit to that, you don't even have to select the full line(s) ... any line partially selected will get commented.
-
Sam Roberts almost 9 yearsAnd Ctrl-T to uncomment.
-
Zoltán almost 5 yearsIn my case it's still
Ctrl+R
, even though I'm using Ubuntu (which is a UNIX system). -
Mzq about 2 yearsuncomment on macOS by default is
alt+command+/