How to count how many times a number repeat in a sequence
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fabio Vicentin
el 9 de Jun. de 2022
Comentada: Fabio Vicentin
el 15 de Jun. de 2022
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 comentarios
Respuesta aceptada
dpb
el 9 de Jun. de 2022
There are other similar submissions with slightly different functionalities; search at your heart's content.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!