Info

此问题已关闭。 请重新打开它进行编辑或回答。

explain the working of this code ??

1 次查看(过去 30 天)
Pratik Mohite
Pratik Mohite 2019-4-22
关闭: MATLAB Answer Bot 2021-8-20
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
It is an inefficient way to count the number of 1's in matrix I

标签

Community Treasure Hunt

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

Start Hunting!

Translated by