在matlab函数中注释掉一部分行 [英] Comment out some part of a line in matlab function

查看:502
本文介绍了在matlab函数中注释掉一部分行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为问题暗示我想在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆