blob: 8d26b333b65710185cc1b9f4dbaac901e9601e1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
//to find the mean,deviations from the mean, Average deviation, standard deviation and variance
clc;
x=[532 548 543 535 546 531 543 536];
X=sum(x);
n=8;
a=0;
Mean=X/n;
disp(X/n,'mean (kHZ)');
for i=1:n,
d(i)=x(i)-Mean
disp(d(i),'deviations =')
a=a+(abs(d(i)))
end
d_average=a/n;
disp(d_average,'Average deviation (kHz)=')
d_2=sum(d^2);
s=sqrt(d_2/(n-1))
disp(s,'standard deviation(kHz)');
V=s^2;
disp(V,'varaince (kHZ)2=')
|