Finding corresponding values between vectors

조회 수: 6 (최근 30일)
Kirby Runyon
Kirby Runyon 2015년 6월 10일
답변: Rong Yu 2015년 6월 11일
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
Guillaume
Guillaume 2015년 6월 11일
@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 2015년 6월 11일
Thank you, Guillaume! I put my suggestion into the answer.

댓글을 달려면 로그인하십시오.

채택된 답변

Rong Yu
Rong Yu 2015년 6월 11일
Try ismember
index = ismember(umps,umps_land);
vmps_land = vmps(index);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by