summaryrefslogtreecommitdiff
path: root/165/CH1/EX1.2/ex1_2.sce
diff options
context:
space:
mode:
Diffstat (limited to '165/CH1/EX1.2/ex1_2.sce')
-rw-r--r--165/CH1/EX1.2/ex1_2.sce13
1 files changed, 13 insertions, 0 deletions
diff --git a/165/CH1/EX1.2/ex1_2.sce b/165/CH1/EX1.2/ex1_2.sce
new file mode 100644
index 000000000..4ed4c0e30
--- /dev/null
+++ b/165/CH1/EX1.2/ex1_2.sce
@@ -0,0 +1,13 @@
+//Example 1.2
+clc;
+//Enter the measurements in a vector
+Xn=[98,101,102,97,101,100,103,98,106,99];
+//Calculate mean
+Y=mean(Xn);
+//Extract the 6th element
+X6=Xn(1,6);
+//Calculate the absolute value
+a=abs((X6-Y)/X6);
+P=1-a;
+printf('\nMean of all the measurements = %.2f \n',Y)
+printf('\nPrecision of 6th measurement = %.3f \n',P) \ No newline at end of file