summaryrefslogtreecommitdiff
path: root/165/CH1/EX1.6/ex1_6.sce
diff options
context:
space:
mode:
Diffstat (limited to '165/CH1/EX1.6/ex1_6.sce')
-rw-r--r--165/CH1/EX1.6/ex1_6.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/165/CH1/EX1.6/ex1_6.sce b/165/CH1/EX1.6/ex1_6.sce
new file mode 100644
index 000000000..0e78feac1
--- /dev/null
+++ b/165/CH1/EX1.6/ex1_6.sce
@@ -0,0 +1,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') \ No newline at end of file