summaryrefslogtreecommitdiff
path: root/331/CH3/EX3.4/Example_3_4.sce
blob: 1a94991487ca9645a2a7a875facae682adf930a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//Caption: Weighted Arithmetic mean of ungrouped data
//Example3.4
//page43
clear;
clc;
X = input('Enter the demand in units =');
w = input('Corresponding Weights=');
n = length(X);
num =0;
den =0;
for i = 1:n
    num = num+w(i)*X(i);
    den = den+w(i);
end
Xw = num/den;
disp(Xw,'The Estimated demand for the Year 2003 is  Xw=');
//Result
//Enter the demand in units = [400,500,450]
//Corresponding Weights= [1,2,3]
//The Estimated demand for the Year 2003 is  Xw=  458.33333