Finding corresponding values between vectors
显示 更早的评论
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 个评论
Rong Yu
2015-6-10
Try ismember
index = ismember(umps,umps_land);
vmps_land = vmps(index);
Kirby Runyon
2015-6-11
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
2015-6-11
Thank you, Guillaume! I put my suggestion into the answer.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!