How to count different value from 2 cell?

Help me please, i have problem to count different value from 2 cell
like :
A = '1' '2' '5' '6' '2' '7' '7' '9' '10' '2' '4' '9' '2' '2'
B = '1' '2' '5' '6' '2' '5' '7' '9' '8' '2' '4' '9' '2' '2'
total different value in B from A is 2 among other is 5 below 7 and 8 below 10, can y'all solve this problem?
new user matlab here:(

 Respuesta aceptada

madhan ravi
madhan ravi el 25 de Feb. de 2019
B(~cellfun(@isequal,B,A))

1 comentario

Angga
Angga el 25 de Feb. de 2019
Editada: Angga el 25 de Feb. de 2019
Thankyou very much Madhan ravi, its work :)

Iniciar sesión para comentar.

Más respuestas (1)

Jan
Jan el 25 de Feb. de 2019
Fast:
sum(strcmp(A, B))

1 comentario

Angga
Angga el 25 de Feb. de 2019
Editada: Angga el 25 de Feb. de 2019
Thankyou very much Jan, its work :)

Iniciar sesión para comentar.

Categorías

Más información sobre Elementary Math en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 25 de Feb. de 2019

Editada:

el 25 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by