Borrar filtros
Borrar filtros

Couild anyone help me to count the number of nonzero elements present in each row of matrix

1 visualización (últimos 30 días)
If i am having a matrix A=[1 0 2 0 3;
4 5 0 0 0;
3 9 0 0 1]
I want to count the number of non zero elements in a row and it shouls display in the following manner.
[3
2
3]
Could anyone please help me on this

Respuesta aceptada

madhan ravi
madhan ravi el 4 de Abr. de 2019

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by