summaryrefslogtreecommitdiff
path: root/2087/CH4/EX4.41/example4_41.sce
blob: 485a31bff7d8c64d5cadc6547d95a6c32a5415bf (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


//example 4.1
//calculate mean rainfall;additional guages needed
clc;funcprot(0);
//given
p=[41 51 32 55 50 68];   //rain guage readings at respective stations
s=0;
for i=1:6
    s=s+p(i);
end
pavg=s/6;
u=0;
for i=1:6
    u=u+(p(i)-pavg)^2;
end
sx=(u/5)^0.5;
Cv=sx*100/pavg;
N=(Cv/8)^2;
N=round(N*100)/100;
mprintf("mean rainfall=%f cm.",pavg);
mprintf("\ntotal stations needed=%f.",N);