Hi everyone, I have 2 matrices, A and B, that I want to use as reference to draw out certain rows in C and attached associated values from D.
A = [1 2];
B = [1 3];
C = [ 1 19 18 4 3 0 0 0 0 0 0
1 19 2 17 6 7 5 4 3 2 0
1 16 15 17 6 7 5 4 3 2 0
1 19 2 3 0 0 0 0 0 0 0
1 16 15 14 9 8 7 5 4 3 2
1 16 15 14 9 6 5 4 3 2 0
1 2 3 0 0 0 0 0 0 0 0
];
D = [0.1
0.3
0.4
0.8
0.9
0.11
0.2
];
my end results for E and F should be:
E = [0.1 1 19 18 4 3 0 0 0 0 0 0
0.8 1 19 2 3 0 0 0 0 0 0 0
0.2 1 2 3 0 0 0 0 0 0 0 0
];
F = [0.3 1 19 2 17 6 7 5 4 3 2 0
0.4 1 16 15 17 6 7 5 4 3 2 0
0.9 1 16 15 14 9 8 7 5 4 3 2
0.11 1 16 15 14 9 6 5 4 3 2 0
];
2 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/480355-selecting-rows-from-c-with-associated-values-in-d-while-using-a-and-b-values-as-references-to-produ#comment_745890
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/480355-selecting-rows-from-c-with-associated-values-in-d-while-using-a-and-b-values-as-references-to-produ#comment_745890
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/480355-selecting-rows-from-c-with-associated-values-in-d-while-using-a-and-b-values-as-references-to-produ#comment_745893
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/480355-selecting-rows-from-c-with-associated-values-in-d-while-using-a-and-b-values-as-references-to-produ#comment_745893
Sign in to comment.