MATLAB: How to set the minimum values of a 3D matrix to 0

3dmatrixdigital image processing

I am trying this for rgb images
But here is an example of what I want:
if true
A=[1,5,7;7,4,2;6,3,1];
A(:,:,2)=[2,5,3;1,6,3;1,8,7];
A(:,:,3)=[5,1,6;3,8,5;9,7,1];
A
end
My desired output is
0 5 7
7 4 2
6 3 0 ____
2 5 3
0 6 3
0 8 7 _____
5 0 6
3 8 5
9 7 0
Thanks in advance !

Best Answer

A(A==min(A(:))) = 0