I have a fuzzy matrix M whose size is 3x3x3such that
M(:,:,1)+M(:,:,2)+M(:,:,3)=matrix one %all elements is one
0<=M(:,:,i)<=1; i=1..3
I want to hide the matrix M to a binary matrix such that
if (M(p,q,i)>=M(p,q,j)) then M(p,q,i)=1, M(p,q,j)=0
where p, q is the position of the element. i, j = 1..3
Please note that if we have already installed M(p,q,i)=1, then there M(p,q,j)should be 0(j = 1..3, j! = I), because I want to sum the binary matrix M, which is still 1 (sum (M, 3) = those ( 3, 3))
Could you help me fulfill this idea in Matlab? Thank you very much.
For instance:
M=zeros([3 3 3]);
M(:,:,1) = [0.2000 0.3000 0.4000;
0.5000 0.6000 0.7000;
0.3000 0.2000 0.1000];
M(:,:,2) = [0.4000 0.1000 0.6000;
0.1000 0.3000 0.1000;
0.1000 0.2000 0.1000];
M(:,:,3) = [0.4000 0.6000 0;
0.4000 0.1000 0.2000;
0.6000 0.6000 0.8000];
My expected result
M_out(:,:,1)=[0 0 0;
1 1 1
0 0 0];
M_out(:,:,2)=[1 0 1;
0 0 0
0 0 0];
M_out(:,:,3)=[0 1 0;
0 0 0
1 1 1];