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 about 1 yearIs there a shortcut to comment multiple lines in matlab. If there isn't can I create one?
-
Setsu almost 8 yearsWhat OS are you working on? Some shortcuts differ slightly between systems. -
user8473076 almost 6 years...& Ctrl+T to un-comment. -
The_Black_Smurf almost 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 8 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 8 yearsAnd Ctrl-T to uncomment. -
Zoltán about 4 yearsIn my case it's stillCtrl+R, even though I'm using Ubuntu (which is a UNIX system). -
Mzq over 1 yearuncomment on macOS by default isalt+command+/