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

1 Ansicht (letzte 30 Tage)
Biswajit
Biswajit am 15 Mär. 2014
Bearbeitet: Azzi Abdelmalek am 15 Mär. 2014
how to calculate no of 1 present in binary matrix in matalb

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 15 Mär. 2014
Bearbeitet: Azzi Abdelmalek am 15 Mär. 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(:))

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by