% plot_MCSimple - wrapper for automatic generation of BER plot

% invoke MCSimpleDriver, then generate the desired plot
MCSimpleDriver;

%% Plot Results with confidence intervals
ErrorRate = NumErrors./NumSymbols;
ConfInt  = ZValue * sqrt( ErrorRate .* (1-ErrorRate) ./ NumSymbols );
errorbar( EsOverN0dB, ErrorRate, ConfInt,'-o' );
set(gca, 'YScale','log' );
grid
xlabel( 'E_s/N_0 (dB)' );
ylabel( 'Symbol Error Rate' );

% plot theretical Pe for BPSK for comparison
hold on
semilogy( EsOverN0dB, Q( sqrt( 2*dB2lin( EsOverN0dB ) ) ), 'r--');
hold off


%% Store name of script for automated figure generation
ScriptName = mfilename;
