Dear all; how to check if at least one array in a logical vector is true? for example: A=[0 0 0 1 0 0] and there is at least one ''1'' in this array.
10 ビュー (過去 30 日間)
古いコメントを表示
Dear all; how to check if at least one array in a logical vector is true? for example: A=[0 0 0 1 0 0] and there is at least one ''1'' in this array.
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2016 年 8 月 12 日
編集済み: Azzi Abdelmalek
2016 年 8 月 12 日
A=[0 0 0 1 0 0]
out=any(A)
To check if theye are all equal to 1 use all(A)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!