Borrar filtros
Borrar filtros

Hi,,I am trying to calculate the weight of a matrix.how can i do that> I am explaining below

1 visualización (últimos 30 días)
Suppose I have a matrix...
A = [1 0 0 0 ;
1 1 0 0 ;
1 1 1 0 ;
1 1 1 1]
how do I calculate that how many coulmns have only one ONE ? TIA

Respuesta aceptada

the cyclist
the cyclist el 31 de Mayo de 2016
numberOfColumnsThatHaveExactlyOneOne = sum(sum(A==1)==1);
  3 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB 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!

Translated by