How to simplify the for loops and if statement in this code

2 次查看(过去 30 天)
How to simplify for loops and if statements.

采纳的回答

dpb
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!

Translated by