如何在续行中添加注释

Son*_*oth 5 matlab

我有这样的功能:

result = myfunc(arg1, ...
                arg2, ...
                arg3);
Run Code Online (Sandbox Code Playgroud)

我想评论出arg2并加入其他内容:

result = myfunc(arg1, ...
         %      arg2, ...    <-- I get a red squiggly underline at the last dot
                arg2b, ...   <-- and under arg2b
                arg3);       <-- and under the closing parenthesis
Run Code Online (Sandbox Code Playgroud)

但是matlab不会让我在续行中发表评论,并且我的所有Google搜索都会出现多行语句或多行注释,但不会出现多行语句中的注释.

错误是"解析错误:使用可能是无效的Matlab语法".

有没有办法做到这一点?

实际上,参数是具有完整路径的长文件名,并且将它们向上移动并且使得代码实际上不可读.

wim*_*wim 6

要注释掉跨越多行的语句的一部分,请使用省略号(...)而不是百分号.例如,

result = myfunc(arg1, ...
            ... arg2, ...
                arg2b, ...
                arg3);
Run Code Online (Sandbox Code Playgroud)