summaryrefslogtreecommitdiff
path: root/165/CH1/EX1.1.a/ex1_1_a.sce
diff options
context:
space:
mode:
Diffstat (limited to '165/CH1/EX1.1.a/ex1_1_a.sce')
-rw-r--r--165/CH1/EX1.1.a/ex1_1_a.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/165/CH1/EX1.1.a/ex1_1_a.sce b/165/CH1/EX1.1.a/ex1_1_a.sce
new file mode 100644
index 000000000..dfe434e63
--- /dev/null
+++ b/165/CH1/EX1.1.a/ex1_1_a.sce
@@ -0,0 +1,14 @@
+//Example 1.1(a)
+clc;
+Yn=80; //Expected value
+Xn=79; //Measured value
+e=Yn-Xn; //Absolute error
+pe=e*100/Yn; //Percentage error
+RA=1-(e/Yn); //Relative Accuracy
+pa=RA*100; //Percentage Accuracy
+printf('\nExpected value = %.2f V\n',Yn)
+printf('\nMeasured value = %.2f V\n',Xn)
+printf('\nAbsolute error = %.2f V\n',e)
+printf('\nPercentage error = %.2f percent\n',pe)
+printf('\nRelative accuracy = %.4f\n',RA)
+printf('\nPercentage accuracy = %.2f percent\n',pa) \ No newline at end of file