explain the working of this code ??

explai workig of this code.
C=0;
[m,n] = size(I);
for p=1:m
for q=1:n
if(I(p,q)==1)
C=C+1;
end
end
end

답변 (1개)

Alex Mcaulley
Alex Mcaulley 2019년 4월 22일

1 개 추천

It is an inefficient way to count the number of 1's in matrix I

이 질문은 마감되었습니다.

태그

질문:

2019년 4월 22일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by