diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /291/CH2/EX2.6a | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '291/CH2/EX2.6a')
-rwxr-xr-x | 291/CH2/EX2.6a/eg2_6a.sce | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/291/CH2/EX2.6a/eg2_6a.sce b/291/CH2/EX2.6a/eg2_6a.sce new file mode 100755 index 000000000..34f9e0e65 --- /dev/null +++ b/291/CH2/EX2.6a/eg2_6a.sce @@ -0,0 +1,14 @@ +temp = [24.2 22.7 30.5 28.6 25.5 32.0 28.6 26.5 25.3 26.0 24.4 24.8 20.6 25.1 21.4 23.7 23.9 25.2 27.4 28.3 28.8 26.6];
+defects = [25 31 36 33 19 24 27 25 16 14 22 23 20 25 25 23 27 30 33 32 35 24];
+temp_new = temp- mean(temp);
+defects_new = defects - mean(defects);
+num=0
+s1 =0;
+s2=0;
+for i=1:22
+ num = num + (temp_new(i)*defects_new(i));
+ s1 = s1 + (temp_new(i)*temp_new(i));
+ s2 = s2 + (defects_new(i)*defects_new(i));
+end
+coefficient = num/sqrt(s1*s2);
+disp(coefficient)
\ No newline at end of file |