A basic question about the counter
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hello, here I have some part of my code. The thing is I want to count the code after 'else'. I can put counter, yes but It counts the total usage of that line. I want to see how many times it is being used in each row of the matris 'vertices'. I mean seperately for each row.
for M=1:m %color
for d=1:D
if abs(left_side(M,1)-vertices(d,1))<0.3 && abs(left_side(M,2)-vertices(d,2))<0.2
if vertices(d,4)==0;
vertices(d,4)=left_side(M,4);
else vertices(d,4)=(vertices(d,4)+left_side(M,4));
end
end
end
end
0 件のコメント
回答 (1 件)
madhan ravi
2020 年 6 月 11 日
counts = 0; % before loop
counts = counts + 1; % inside else part
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!