<分区>
我是 matlab 的新手。有人可以从下面的代码中告诉我 3 点 ( ... ) 是什么意思吗?
defaults = struct(...
'ThresholdDelta', 5*190/255, ...
'RegionAreaRange', [180 1000], ...
'MaxAreaVariation', 0.25,...
'ROI', [1 1 imgSize(2) imgSize(1)]);
标签 matlab
<分区>
我是 matlab 的新手。有人可以从下面的代码中告诉我 3 点 ( ... ) 是什么意思吗?
defaults = struct(...
'ThresholdDelta', 5*190/255, ...
'RegionAreaRange', [180 1000], ...
'MaxAreaVariation', 0.25,...
'ROI', [1 1 imgSize(2) imgSize(1)]);
最佳答案
三个点表示续行。
所以语法:
defaults = struct(...
'ThresholdDelta', 5*190/255);
严格等同于:
defaults = struct('ThresholdDelta', 5*190/255);
Matlab 表达式通常在行尾结束,除非它们特别用 ...
继续。所以语法:
defaults = struct(
'ThresholdDelta', 5*190/255);
产生错误(表达式或语句不正确——可能不平衡(、{ 或 [.
)。
需要注意的是,上述规则有一个异常(exception):在数组构建运算符 []
中接受新行而不需要 ...
它类似于冒号 ;
。例如:
>> a = [1 2 % Use shift+Enter in the command line to go start a new line
3 4]
a =
1 2
3 4
关于matlab - 3点在matlab中意味着什么(...)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45682027/