matlab中3个点是什么意思(...)?

Dom*_*nic 3 matlab

我是matlab新手。有人可以从下面的代码中告诉我那个 3 点 (...) 是什么意思吗?

defaults = struct(...
'ThresholdDelta', 5*190/255, ...
'RegionAreaRange', [180 1000], ...
'MaxAreaVariation', 0.25,...
'ROI', [1 1 imgSize(2) imgSize(1)]);
Run Code Online (Sandbox Code Playgroud)

Rat*_*ert 6

三个点表示行的延续。

所以语法:

defaults = struct(...
'ThresholdDelta', 5*190/255);
Run Code Online (Sandbox Code Playgroud)

严格等同于:

defaults = struct('ThresholdDelta', 5*190/255);
Run Code Online (Sandbox Code Playgroud)

Matlab 表达式通常在行尾结束,除非它们特别以 继续...。所以语法:

defaults = struct(
'ThresholdDelta', 5*190/255);
Run Code Online (Sandbox Code Playgroud)

产生错误(Expression or statement is incorrect--possibly unbalanced (, {, or [. )。

但需要郑重声明的是,上述规则有一个例外:在数组构建运算符中,[]无需使用新行即可接受...,它类似于冒号;。例如:

>> a = [1 2     % Use shift+Enter in the command line to go start a new line 
3 4]

a =

     1     2
     3     4
Run Code Online (Sandbox Code Playgroud)