Filter löschen
Filter löschen

Finding corresponding values between vectors

1 Ansicht (letzte 30 Tage)
Kirby Runyon
Kirby Runyon am 10 Jun. 2015
Beantwortet: Rong Yu am 11 Jun. 2015
umps_land is a vector and a subset of vector umps. The subset was selected graphically using the brush. vmps is a vector the same size as umps. I want to (non-graphically) find the values of vmps that correspond to umps_land and call it vmps_land. How do I accomplish this seemingly easy operation? (and why can't I find documentation on this??)
  4 Kommentare
Guillaume
Guillaume am 11 Jun. 2015
@Rong Yu, in the future post your answer as an answer rather than a comment to the question. That way the OP can accept your answer and you get reputation.
Rong Yu
Rong Yu am 11 Jun. 2015
Thank you, Guillaume! I put my suggestion into the answer.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Rong Yu
Rong Yu am 11 Jun. 2015
Try ismember
index = ismember(umps,umps_land);
vmps_land = vmps(index);

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by