Comment out some part of a line in matlab function

前端 未结 2 1138
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 10:52

As the question suggests I want to comment out some part of a line in MATLAB.

Also I want to comment out some part of a line not till the end of line.

Reason

2条回答
  •  失恋的感觉
    2020-12-06 11:04

    Within one line is not possible (afaik), but you can split up your term into multiple lines:

    x=1+2+3 ... optional comments for each line
    ... * factorA ... can be inserted here
    * factorB ...
    +4;
    

    Here * factorA is commented out and * factorB is used, resulting in the term x=1+2+3*factorB+4.

    The documentation contains a similar example, commenting out one part of an array:

    header = ['Last Name, ',      ...
              'First Name, ',     ...
          ... 'Middle Initial, ', ...
              'Title']
    

提交回复
热议问题