相关代码 |
|
function f=target(T,M) dT=double(T); [U,V]=size(T); W=length(M);f=zeros(W,1); for k=1:W s1=0;I=0;s2=0;J=0; for i=1:U for j=1:V if T(i,j) s1=s1+dT(i,j);I=I+1; end if T(i,j)>M(k) s2=s2+dT(i,j);J=J+1; end end end p1=s1/I;p2=s2/J; f(k)=I*J*(p1-p2)*(p1-p2)/(256*256*256*256); end
相关资源 |
|