chee
chee

Reputation: 979

how to find the corresponding point in other row of an array in matlab?

i have an array lets say

x =

 1     2     2
 5     8     7

now i want to get the corresponding values of a number in 2nd row. like i have number =2

and i want

ans= 8 and 7

as 8 and 7 are the corresponding points for 2.

Upvotes: 0

Views: 987

Answers (1)

High Performance Mark
High Performance Mark

Reputation: 78316

X(2,X(1,:)==2)

should do. Hope you can figure out how.

Upvotes: 5

Related Questions