blob: d1a2521c4e05c1d13136ad50a211c09acdddb7e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// To find difference with range of doubt
// Modern Electronic Instrumentation And Measurement Techniques
// By Albert D. Helfrick, William D. Cooper
// First Edition Second Impression, 2009
// Dorling Kindersly Pvt. Ltd. India
// Example 1-5 in Page 5
clear; clc; close;
// Given data
// let N_1 = X_1 +/- Y_1
// N_2 = X_2 +/- Y_2
X_1 = 826;
Y_1 = 5;
X_2 = 628;
Y_2 = 3;
//Calculations
X = (X_1 - X_2);
Y = (Y_1 + Y_2);
printf("Difference = %d +/- %d\n",X,Y);
%doubt = Y/X*100;
printf("The percentage range of doubt = +/-%0.2f%%",%doubt);
//Result
// Difference = 198 +/- 8
// The percentage range of doubt = +/-4.04%
|