⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 entropy.m

📁 覆盖了全书的信号与线性系统、随机过程、模拟调制、模拟数字转换、基带数字传输、带限信道的数字传输、载波调制的数字传输、信道容量和编码、扩频通信系统以及数字调制方法的SIMULINK仿真的 源代码
💻 M
字号:
function h=entropy(p)
%		H=ENTROPY(P) returns the entropy function of 
%		the probability vector P.
if length(find(p<0))~=0,
  error('Not a prob. vector, negative component(s)')
end
if abs(sum(p)-1)>10e-10,
  error('Not a prob. vector, components do not add up to 1')
end
h=sum(-p.*log2(p));

⌨️ 快捷键说明

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