String matrix compare to get common in rows
Mostrar comentarios más antiguos
Deal all, i have a problem to compare two string matrix :
A1 = {'AA', 'b' ; 'cc', 'ff'}
A2 = {'ee', 'AA' ; 'hhh', 'm'}
strcmp(A1,A2)
I get
A1 =
'AA' 'b'
'cc' 'ff'
A2 =
'ee' 'AA'
'hhh' 'm'
ans =
0 0
0 0
But i need to get
'AA' is common between A1 iand A2 in the row 1
Best regard
Respuesta aceptada
Más respuestas (1)
Geoff Hayes
el 27 de Jun. de 2019
>> ismember(A1,A2)
ans =
1 0
0 0
5 comentarios
Touts Touts
el 27 de Jun. de 2019
Geoff Hayes
el 27 de Jun. de 2019
So if 'AA' is in the second row, do you expect to see
'AA' : 2
? What happens if 'AA' is in more than one row?
Touts Touts
el 27 de Jun. de 2019
- what happens if 'AA' occurs on different rows?
- what happens if 'AA' occurs multiple times within one matrix?
Touts Touts
el 28 de Jun. de 2019
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!