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

조회 수: 4 (최근 30일)
Biswajit
Biswajit 2014년 3월 15일
편집: Azzi Abdelmalek 2014년 3월 15일
how to calculate no of 1 present in binary matrix in matalb

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 3월 15일
편집: Azzi Abdelmalek 2014년 3월 15일
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(:))

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by