Program Code
% Normal Distributionclc;
close all;
clear all;
x=input('Enter the input sequence ');
m=input('Enter the value of mean ');
s=input('Enter the standard deviation ');
n=length(x);
a=-(x-m).^2;
b=a/(2*s^2);
c=1/(s*((2*pi)^(1/2)));
d=exp(b);
y=c*d;
t=0:n-1;
plot(t,y);
title('Normal Distribution');
grid on;
Example of Output
Enter the input sequence [125 135 145 155 165 175 185 195]Enter the value of mean 165.5
Enter the standard deviation 15.26
_______________________
No comments:
Post a Comment
Please write your opinion about this MATLAB program here, only in English.