Borrar filtros
Borrar filtros

how to calculate no of 1 present in binary matrix in matalb

1 visualización (últimos 30 días)
Biswajit
Biswajit el 15 de Mzo. de 2014
Editada: Azzi Abdelmalek el 15 de Mzo. de 2014
how to calculate no of 1 present in binary matrix in matalb

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 15 de Mzo. de 2014
Editada: Azzi Abdelmalek el 15 de Mzo. de 2014
not(A)
% Example
A=[1 0; 0 0]
B=not(A)
B=
[0 1
1 1]
% or maybe you mean number by no
out=sum(A(:))

Categorías

Más información sobre Line Plots 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