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