How can I find the common elements of 2 cell arrays of strings?

65 visualizaciones (últimos 30 días)
I have 2 cell arrays containing strings. I would like to find the elements that are common to both arrays and get their positions. Is there a function to do that?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 14 de Abr. de 2014
Use the "intersect" function as follows:
>> [C,ia,ib] = intersect(A,B, 'stable');

Más respuestas (0)

Categorías

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

Productos


Versión

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by