finding all instances in a vector
Mostrar comentarios más antiguos
Hi all,
is there an easy way to find all instances of, say, numbers in vector x in a target vector, y?
For example, if I have a vector x which is: [ 1 4 10 ] how do i find all 1's 4's and 10's in y: [ 1 2 3 4 5 6 7 8 9 10 ]
sorry if this is a basic question.. i could write a for-loop of course, but i imagine there must be a more elegant way to do this. Thanks in advance!
2 comentarios
Liz
el 21 de Jul. de 2011
the cyclist
el 21 de Jul. de 2011
No problem that this is a basic question! You asked it clearly and specifically, with an example of what you wanted. Good question.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical 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!