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

Risposte (1)

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(:))

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Richiesto:

il 15 Mar 2014

Modificato:

il 15 Mar 2014

Community Treasure Hunt

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

Start Hunting!

Translated by