MKS*_*MKS 8 indexing matlab
我有一个矩阵A.现在我想找到大于5的元素数量及其相应的索引.如何在不使用for循环的情况下在matlab中解决这个问题?
A
例如,如果A = [1 4 6 8 9 5 6 8 9]':
A = [1 4 6 8 9 5 6 8 9]'
[3 4 5 7 8 9]
Jon*_*nas 14
你用find:
find
index = find(A>5); numberOfElements = length(index);
归档时间:
13 年,1 月 前
查看次数:
39431 次
最近记录:
13 年 前