How to do group commenting without commenting each line in Matlab?

前端 未结 5 1218
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 07:52

How can I comment a group of lines without commenting each line?

ie like \'c\'

/*
printf(\"hello\");
printf(\"there\");
*/

in Matla

相关标签:
5条回答
  • 2020-12-31 07:59

    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...

    0 讨论(0)
  • 2020-12-31 08:02

    Select all lines then do:
    for comment: from Text menu-->comment
    for uncomment: from Text menu-->uncomment

    0 讨论(0)
  • 2020-12-31 08:03

    You can use keyboard shortcuts:

    To comment multiple lines: CTRL + r

    To uncomment multiple lines: CTRL + t

    It works perfect in Matlab 2016.

    0 讨论(0)
  • 2020-12-31 08:19

    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)
    
    0 讨论(0)
  • 2020-12-31 08:22

    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

    0 讨论(0)
提交回复
热议问题