How do you return the value of one vector at specified value of another vector
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
balsip
el 26 de En. de 2017
I want to return the value of a vector A at the specified value of vector B.
So, when vector B = 805, I'd like code to return the value of vector A.
They're the same length.
0 comentarios
Respuesta aceptada
Matt J
el 26 de En. de 2017
Editada: Matt J
el 26 de En. de 2017
It's not entirely clear what you mean. Possibly, you want this
A(B==805)
or you could mean,
A(B)
Más respuestas (1)
John D'Errico
el 26 de En. de 2017
Why have you not tried the obvious? What does
A(B)
provide?
It appears that you need to spend time reading the getting started tutorials for MATLAB if you do not understand how to use an index.
0 comentarios
Ver también
Categorías
Más información sobre Logical 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!