clear all p=.00001:.001:1; H=-(p.*log(p)+(1-p).*log(1-p))/log(2); plot(p,H,'r-','linewidth',3) box