summaryrefslogtreecommitdiff
path: root/165/CH1/EX1.6/ex1_6.sce
blob: 0e78feac1e973492ec767767df813f49d8a06643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//Example 1.6
clc;
d_dev=[];
Xn=[49.7,50.1,50.2,49.6,49.7];    //Given Data
X=mean(Xn);                       //Mean
for i=1:5
    d=Xn(1,i)-X;
    d_dev=[d_dev,d^2];
end
sq_sum=sum(d_dev);
var=sq_sum/4;
//For small no of data(n<30) we use n-1 as the
//denominator so as to obtain a more accurate value
//for Standard deviation
Std_dev=sqrt(var);                //Std deviation
disp(Std_dev,'Standard deviation')