The variables which can be copy/paste to Matlab.
a = [5 6 7 9 1 2 5 6 3 8 9 0];
A = [1 3 6 2;2 4 1 9; 2 3 5 6];
B = a(A);
From the variables above,
Matrix B is [5 7 2 6; 6 9 5 3; 6 7 1 2]. However, Actually the condition is set to >=6 which are replaced by the element in Matrix A. So, the desired result is:
DesiredResult = [5 3 2 2; 2 4 5 3; 2 3 1 2];
Best Answer