MATLAB: Replace elements of a matrix

replace

UPDATE: I expanded and updated the question and posted it as a new one. here : https://uk.mathworks.com/matlabcentral/answers/442116-match-and-replace-matrix-elements
To everyone else: If you can chill out on telling me with a link to this post that "ooh look you already asked it", you will help keep off clutter in the answer window while I await an answer.
A = [1 4 3; 2 3 2;4 2 1….] (this is a 90 row matrix)
How do I make the follwing replacemetns in A using Logicals
4 with10
3 with 15
2 with 20
1 with 30

Best Answer

A = [1 4 3; 2 3 2;4 2 1;10,7,1];
b = [4 ,10
3 , 15
2 ,20
1 , 30];
[lo,ii] = ismember(A,b(:,1));
A(lo) = b(ii(lo),2);
ADD:
A = [0.22, 0.3, 0.456; 0.3, 0.456,0.456;.22,.526,.7];
b = [0.22,93.55; 0.30, 91.05; 0.456,89.58 ];
A = A + eps(100)*(rand(size(A))-.5)*2;
solution:
[lo,ii] = ismembertol(A,b(:,1),eps(1e3),'DataScale',1);
A(lo) = b(ii(lo),2);