function ixy=cap_using_confu_mat(m)

m1=m/sum(sum(m)); 
hxy=-1*sum(sum(m1.*log(m1+eps)));

m1=sum(m,1);
m1=m1/sum(m1);
hx=-1*sum(m1.*log(m1));

m2=sum(m,2); 
m2=m2/sum(m2);
hy=-1*sum(m2.*log(m2));

ixy=hy+hx-hxy;
