I have something like the following:
X = [1 5; 2 5; 3 7; 4 7; 5 2; 6 7];
X =
1 5
2 5
3 7
4 7
5 2
6 7
b = [1;4;6];
b =
1
4
6
Is there a way to lookup the values (from X), input as b, to output the following:
b1 =
1 5
4 7
6 7
If you’re sure that the values of
bare within the range ofX:or if the first column of
Xisn’t1:N: