How to count how many times a number repeat in a sequence
조회 수: 3 (최근 30일)
이전 댓글 표시
I have an matrix:
Result = [ 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 1 1 0 1 ....] so on until row 24.926
And i want to count in this way (how many times the zeros or one repeat and change in value):
One = [1 1 1 0 1 1 0 1 1 1 0 1 1 1 0 0 1 1 1 ...]
Two = [0 0 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 ...]
Three = [0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ...]
Four = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...]
Five = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...]
Any good help is appreciated.
댓글 수: 0
채택된 답변
dpb
2022년 6월 9일
There are other similar submissions with slightly different functionalities; search at your heart's content.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!