在matlab函数中注释掉一部分行 [英] Comment out some part of a line in matlab function
问题描述
因为问题暗示我想在MATLAB中注释掉一行的某些部分。
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 for this is, I have to try two different versions of a line and I don't want to replicate the line twice. I know it is easy to comment/uncomment if I replicate the line , But I want it this way.
推荐答案
在一行内,我可以很方便地注释/取消注释是不可能的(afaik),但你可以将你的期限分成多行:
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;
这里 * factorA
使用code> * factorB ,导致术语 x = 1 + 2 + 3 * factorB + 4
。
Here * factorA
is commented out and * factorB
is used, resulting in the term x=1+2+3*factorB+4
.
这篇关于在matlab函数中注释掉一部分行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!