%ECOMMS Spring '00 Classroom Demo
%S. Mandayam, ECE Dept., Rowan University
%Entropy in a Binary Digital Source

close all;clear;
p=0:0.1:1;
h=p.*log2(1./p)+(1-p).*log2(1./(1-p));
plot(p,h);
grid on;
xlabel('Probability,P');
ylabel('Entropy,H');
title('Entropy of a Binary Digital Source');