How to look for a list insto an other list
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Gimpy
el 5 de Ag. de 2014
Respondida: Sean de Wolski
el 5 de Ag. de 2014
Hi, I have the following list:
lookfor={'ab' 'cd' 'ef' 'ab' 'cd''gh' 'ij' 'ab' 'cd'}
into={'ab' 'cd' 'ef' 'gh' 'ij'}
I would like to know the colunm number for each element in "into" reults: [1 2 3 1 2...]
0 comentarios
Respuesta aceptada
Sean de Wolski
el 5 de Ag. de 2014
lookf={'ab' 'cd' 'ef' 'ab' 'cd' 'gh' 'ij' 'ab' 'cd'}
into={'ab' 'cd' 'ef' 'gh' 'ij'}
[~, idx] = ismember(into,lookf)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Solar Power en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!