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

2 visualizzazioni (ultimi 30 giorni)
How to simplify for loops and if statements.
  1 Commento
dpb
dpb il 23 Giu 2020
Please restore the original post -- there's no context for others going forward now.

Accedi per commentare.

Risposta accettata

dpb
dpb il 19 Giu 2020
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')];

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by