getinf.m

来自「压缩文件中是Error Correction Coding - Mathemat」· M 代码 · 共 24 行

M
24
字号
function [I] = getinf(histN,histX)% where histN and histX are the output of%  a [N,X] = hist(...) function call% That is, N is the frequencies, X are the bin centers% Center bin must be at Zero% I is the mutual informationlnX = length(histX);for k=1:lnX    if(histN(k))        Ia(k) = (histN(k)/sum(histN))*log2((histN(k))/(0.5*(histN(k)+histN(lnX+1-k))));    else        Ia(k)=0;    endendfor(k=1:lnX)    Ib(k) = Ia(k) + Ia(lnX+1-k);endI = 0.5*sum(Ib);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?