diff options
Diffstat (limited to '331/CH3/EX3.7/Example_3_7.sce')
-rwxr-xr-x | 331/CH3/EX3.7/Example_3_7.sce | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/331/CH3/EX3.7/Example_3_7.sce b/331/CH3/EX3.7/Example_3_7.sce new file mode 100755 index 000000000..d9e0aac79 --- /dev/null +++ b/331/CH3/EX3.7/Example_3_7.sce @@ -0,0 +1,22 @@ +//Caption: Median of Ungrouped data +//Example3.7 +//Page45 +clear; +clc; +X = [100000,150000,300000,175000,300000,400000]; +X_Ascend = gsort(X,'g','i'); +disp(X_Ascend) +n = length(X); +if (modulo(n,2)==1) then + median_X = X((n-1)/2); +else + median_X = (X(n/2)+X((n+2)/2))/2; +end +disp(median_X,'Median Value of sales Median_X = '); +//Result +// +// 100000. 150000. 175000. 300000. 300000. 400000. +// +// Median Value of sales Median_X = +// +// 237500.
\ No newline at end of file |