How to simplify the for loops and if statement in this code
2 次查看(过去 30 天)
显示 更早的评论
How to simplify for loops and if statements.
1 个评论
采纳的回答
dpb
2020-6-19
Straightahead w/o trying to save some recomputations that could be done by complements--
k=[sum(A==B & A==0,'all') sum(A==B & A~=0,'all');sum(A~=B & A==0,'all') sum(A==B & A==1,'all')];
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!