Azzera filtri
Azzera filtri

array operation in matlab

1 visualizzazione (ultimi 30 giorni)
ali hassan
ali hassan il 14 Feb 2022
Modificato: Matt J il 14 Feb 2022
if i have type cell:
a=['hi' 'lo' 'hi'];
b=['lo' 'hi' 'hi'];
how can i find total number of times when there is 'hi' in a and 'hi' in b as well?

Risposta accettata

Matt J
Matt J il 14 Feb 2022
Modificato: Matt J il 14 Feb 2022
a={'hi' 'lo' 'hi'};
b={'lo' 'hi' 'hi'};
nnz(string(a)=="hi" & string(b)=="hi")
ans = 1

Più risposte (0)

Categorie

Scopri di più su Dialog Boxes 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