您现在的位置:首页 >> ★免费资源 >> 源码下载 >> 内容

MATLAB代做-python代做-FPGA代做- EMI

时间:2019-6-24 0:53:47 点击:

  核心提示:MATLAB代做-python代做-FPGA代做- EMI...
%Caculate MI of a and b in the region of the size(a)

function [mi] = EMI(a,b)
%
[M,N] = size(a);
% change a, b to range 1:n
if min(a(:))<1
    a = a-min(a(:))+1;
end
if min(b(:))<1
    b = b-min(b(:))+1;
end
    

% ncolora = max(a(:))-min(a(:))+1;
% ncolorb = max(b(:))-min(b(:))+1;
ncolora = max(a(:));
ncolorb = max(b(:));

hab = zeros(ncolora,ncolorb);
ha = zeros(1,ncolora);
hb = zeros(1,ncolorb);

%count begins
[M,N]=size(a);
for i=1:M
    for j=1:N
       indexx =  a(i,j);
       indexy =  b(i,j);

       hab(indexx,indexy) = hab(indexx,indexy)+1;
       ha(indexx) = ha(indexx)+1;
       hb(indexy) = hb(indexy)+1;

   end
end

%cal ha,hb,hab
hsum = sum(sum(hab));
index = find(hab~=0);
p = hab/hsum;
Hab = sum(sum(-p(index).*log(p(index))));

hsum = sum(sum(ha));
index = find(ha~=0);
p = ha/hsum;
Ha = sum(sum(-p(index).*log(p(index))));

hsum = sum(sum(hb));
index = find(hb~=0);
p = hb/hsum;
Hb = sum(sum(-p(index).*log(p(index))));

mi = Ha+Hb-Hab;
% cal EMI
% feature efficiency coefficient
n =2/5;
if Hab ~= 0
    e = (mi^n) / ( Hab^(1-n));
else% not usual happen, just for test
    e = -1;%(mi^n) / ( Hab^(1-n)+1e-10);
end
mi = e;
% % 

联系:highspeedlogic

QQ :1224848052

微信:HuangL1121

邮箱:1224848052@qq.com

网站:http://www.mat7lab.com/

网站:http://www.hslogic.com/

微信扫一扫:

Tags:EMI 
作者:EMI 来源:EMI
  • 您是如何找到本站的?
  • 百度搜索
  • Google搜索
  • 查阅资料过程中
  • 论坛发现
  • 百度贴吧发现
  • 朋友介绍
本站最新成功开发工程项目案例
相关文章
  • 没有相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
  • matlab代做|matlab专业代做|matlab淘宝代做(www.hslogic.com) © 2019 版权所有 All Rights Reserved.
  • Email:highspeed_logic@163.com 站长QQ: 1224848052

    专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文,毕业论文,Coursework、Eassy、Assignment