【发布时间】:2011-09-20 23:25:09
【问题描述】:
我试图在 matlab 中对一个数字数组使用模式函数(该数组中存在一些负负数)。 但是当我这样做时
模式(this_array)
我得到“尝试访问模式(-1);索引必须是正整数或逻辑”。
以下是我的一段代码:
for row=1:K,
ind = index(row);
label = trY(ind);
i = i + 1;
end % for
y = mode(label); // gives error esp. when the array contains only one negative value
谢谢。
【问题讨论】:
标签: matlab