Borrar filtros
Borrar filtros

array operation in matlab

1 visualización (últimos 30 días)
ali hassan
ali hassan el 14 de Feb. de 2022
Editada: Matt J el 14 de Feb. de 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?

Respuesta aceptada

Matt J
Matt J el 14 de Feb. de 2022
Editada: Matt J el 14 de Feb. de 2022
a={'hi' 'lo' 'hi'};
b={'lo' 'hi' 'hi'};
nnz(string(a)=="hi" & string(b)=="hi")
ans = 1

Más respuestas (0)

Categorías

Más información sobre Dialog Boxes en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by