Code covered by the BSD License  

Highlights from
Contemporary Communications Systems Matlab Files

image thumbnail

Contemporary Communications Systems Matlab Files

by

 

Matlab Files in this book

ip_08_07.m
% MATLAB script for Illustrative Problem 8.7 
clear
echo on
ep=0.3;
for i=1:2:61
  p(i)=0;
  for j=(i+1)/2:i
    p(i)=p(i)+prod(1:i)/(prod(1:j)*prod(1:(i-j)))*ep^j*(1-ep)^(i-j);
    echo off ;
  end
end
echo on ;
pause % Press a key to see the plot.
stem((1:2:61),p(1:2:61))
xlabel('n')
ylabel('pe')
title('Error probability as a function of n in simple repetition code')

Contact us