Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How do I count to occurences of a number in an unsanitized array
조회 수: 1 (최근 30일)
이전 댓글 표시
Say I have cell A, with values:
0
0
1
[0; 1; 0]
1
Now I want to count the occurences of 1 is this matrix, and [0; 1; 0] should be ignored.
However, when I do:
amount_correct = sum(A == 1);
I get an error as soon as it arrives at [0; 1; 0].
I however simply want it to give as output 0 and move on to the next element of the array till I get to the end.
The eventual output should be 2.
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!