summaryrefslogtreecommitdiff
path: root/1415/CH1/EX1.4.3
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1415/CH1/EX1.4.3
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '1415/CH1/EX1.4.3')
-rw-r--r--1415/CH1/EX1.4.3/ex3.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/1415/CH1/EX1.4.3/ex3.sce b/1415/CH1/EX1.4.3/ex3.sce
new file mode 100644
index 000000000..9053c2ed6
--- /dev/null
+++ b/1415/CH1/EX1.4.3/ex3.sce
@@ -0,0 +1,27 @@
+//Example 3 Page 100
+clc
+clear
+
+x=[0 2 4 6 8 10 12 14]//assigning the values of x
+y=[9 9 10 11 11 12 13 13]//assigning the values of y
+disp(x,'x:')//displaying x values
+disp(y,'y:')//displaying y values
+xy=x.*y//calculating xy
+disp(xy,'xy:')//displaying xy values
+x2=x^2;//calculating x^2 values
+disp(x2,'x square:')//displaying x^2 values
+y2=y^2;//calculating y^2 values
+disp(y2,'y square:')//displaying y^2 values
+sumx=sum(x)//calculating sum of x
+disp(sumx,'sum(x)')//displaying x values
+sumy=sum(y)//calculating sum of y
+disp(sumy,'sum(y)')//displaying y values
+sumxy=sum(xy)//calculating sum of xy
+disp(sumxy,'sum(xy)')//displaying xy values
+sumx2=sum(x2)//calculating sum of x^2
+disp(sumx2,'sum(x2)')//displaying x^2 values
+sumy2=sum(y2)//calculating sum of y^2
+disp(sumy2,'sum(y2)')//displaying y^2 values
+n=8//given as n=8
+r=(((n*(sumxy))-(sumx*sumy))/((sqrt((n*sumx2)-((sumx)^2)))*(sqrt((n*sumy2)-((sumy)^2)))))//calculating r value
+disp(r,'the value of r is :')//displaying r value