How to find some specific values of an array in another matrix ?
Show older comments
Hi, I have one <4X2> matrix that looks like x=[2 3 7 8 (Column1), 10 20 30 40(Column2)]. I have another <39X2> matrix that looks like y= [2:40 (column1), 39 specific values in column2]. I would like to find the column1 values of matrix x (2,3,7,8) in matrix y column1 (2:40) and then save the corresponding matrix y column2 values in a new matrix y1. For example: y1=[2 3 7 8, the corresponding specific values from the column2 of y matrix].
Special note: the values of matrix x=[2 3 7 8 (Column1), 10 20 30 40(Column2)] may change in different situations. So, it can also be x=[3 7 9 11, 30 50 70 90] at another time. But the matrix y is always fixed with same values.
Thank you so much for helping me out.
2 Comments
Azzi Abdelmalek
on 7 Jun 2015
Your question is hard to read. Post an example without writing (column 1), we know it's column 1. And post what is the expected result.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!