diff options
Diffstat (limited to '1970/CH4/EX4.12/Ch04Exa12.sce')
-rwxr-xr-x | 1970/CH4/EX4.12/Ch04Exa12.sce | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/1970/CH4/EX4.12/Ch04Exa12.sce b/1970/CH4/EX4.12/Ch04Exa12.sce new file mode 100755 index 000000000..9ccd33476 --- /dev/null +++ b/1970/CH4/EX4.12/Ch04Exa12.sce @@ -0,0 +1,33 @@ +// Scilab code Exa4.12 : : Page 181 (2011)
+// Defining an array
+clc; clear;
+n = cell (1,6); // Declare the cell matrix of 1X6
+n(1,1).entries = 10000;
+n(2,1).entries = 10200;
+n(3,1).entries = 10400;
+n(4,1).entries = 10600;
+n(5,1).entries = 10800;
+n(6,1).entries = 11000;
+g = 0; //
+k = 6;
+H = 0;
+for i = 1:k;
+ g = g + n(i,1).entries
+end;
+N = g/k; // Mean of the count
+D = sqrt(N);
+for i = 1:k;
+ H = H+((n(i,1).entries-N)*(n(i,1).entries-N))
+end;
+S_D = round(sqrt(H/(k-1)));
+printf("\nStandard deviation of the reading : %d", S_D);
+delta_N = sqrt(N);
+if (S_D > delta_N) then
+ printf("\nThe foil cannot be considered uniform..!");
+else
+ printf("\nThe foil can be considered uniform.");
+end
+
+// Result
+// Standard deviation of the reading : 374
+// The foil cannot be considered uniform..!
\ No newline at end of file |