how to make sum of same elements in binary matrix
이전 댓글 표시
hello. how to make sum of same elements in binary matrix by using "for"? code that a made makes only sum of true elements. i want to make sum of all elements...
if true
function SumE = compare( BW1 , BW2 )
for a=1:110
for b=1:110
if (BW1(a,b)==BW2(a,b))
SumE=SumE+1;
end
end
end
end
end
댓글 수: 2
Azzi Abdelmalek
2014년 3월 22일
This is not clear, can you illustrate with a short example?
Jan
2014년 3월 22일
You code fails due to the missing definition of SumE before the loops.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!