Counting certain values from an array
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vadim Tambovtsev
el 22 de Sept. de 2016
Editada: Image Analyst
el 22 de Sept. de 2016
Suppose we have an array r=(2,2,2) filled with zeros and ones. How to count up how many zeros and how many ones do we have?
0 comentarios
Respuesta aceptada
Image Analyst
el 22 de Sept. de 2016
Try this:
numOnes = sum(r(:))
numZeros = numel(r) - numOnes
Más respuestas (0)
Ver también
Categorías
Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!