Comparing cell arrays of strings of unequal size/replacing missing values with zeroes
Mostrar comentarios más antiguos
I have two cell arrays of strings of unequal size:
A = {'dog','cat'};
B = {'dog ','cat','fish ','horse'};
How can I compare A with B string-by-string and put a zero (0) where strings in B are not in A?
I would expect a result kind of that:
B = {'dog ','cat', 0, 0};
1 comentario
James Tursa
el 6 de Mzo. de 2015
+1 for showing an explicit example with expected result!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!