How can I set the minimum values of a 3D matrix to 0 ?

1 次查看(过去 30 天)
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 !

采纳的回答

Andrei Bobrov
Andrei Bobrov 2015-4-30
A(A==min(A(:))) = 0

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by