Sunday, February 5, 2012

Normal Distributions in MatLab

%% Normal Distributions in Matlab
% James Eastham
% Member, IEEE
% Created on: 2/5/2012
%
% The following code creates multiple normal distributions

figure('Color',[1 1 1]);
x = 17:0.1:28; %Plot range

pop_average = 21.98; %population mean
sigma = .4; %population sigma
normal_dist = normpdf(x, pop_average, sigma);
plot(x, normal_dist,'LineWidth',3);hold on;

pop_average = 22.89;
sigma = .244;
normal_dist = normpdf(x, pop_average, sigma);
plot(x, normal_dist,'--r','LineWidth',3);hold on;

pop_average = 21.84;
sigma = .78;
normal_dist = normpdf(x, pop_average, sigma);
plot(x, normal_dist,'-.g','LineWidth',3);hold on;

pop_average = 22.24;
sigma = .91;
normal_dist = normpdf(x, pop_average, sigma);
plot(x, normal_dist,'-ko','LineWidth',3);hold on;

legend('build 1','build 2','build 3','overall')
grid on;
title('Design Build Performance');
xlabel('Gain(dB)');