Using MATLAB, I would like to create a new vector, in which the values in the original vector are replaced by corresponding numbers from another matrix.
Specifically, I have a large vector (30,000 x 1) in which the individual values in each cell correspond to locations in the brain (range: 0 - 166). These values are somewhat randomly spread across the vector (they correspond to brain locations). After running an experiment, I would now like to replace each instance of these values with a value that I've calculated experimentally. These values are stored in a corresponding matrix (167 x 2): the first column contains the value from the original matrix (0 - 166) and the second column contains the new value I'd like to replace the original value (0 - 6). So for example, if value 150 was associated with a score of 5 in my experiment, I'd like to replace each instance of 150 with a 5 in the original matrix.
original vector: [1; 1; 1; 1; 2; 2; 2; 2; 1; 1; 1; 1; 1; 1; 2; 2; 2; 2; ...]
identity matrix: [0 0; 1 4; 2 5; 3 2; ...]
new vector: [4; 4; 4; 4; 5; 5; 5; 5; 4; 4; 4; 4; 4; 4; 5; 5; 5; 5; ...]
Is there an easy way to solve this?
Thanks