Student name:__________________________________
2
Problem 1.
(35 points)
Carefully examine the Matlab® session shown below.
The resulting figures are on the next page.
Then respond to the itemized questions listed on the following page. The matrix
x
used in the
analysis has two columns. The first column lists the annual maximum flows in a river and the
second column lists the corresponding annual minimum flows, both in units of m
3
/s.
>> clear all
>> x = load('RiverFlow.dat');
>> whos
Name
Size
Bytes
Class
data
31x2
496
double array
>> min(x)
ans =
2220
306
>> max(x)
ans =
8850
1157
>> Fmax = x(:,1);
>> Fmin = x(:,2);
>> c1 = [2000:1000:9000];
>> c2 = [300:100:1200];
>> subplot(1,2,1);
normfreq(Fmax,c1)
>> subplot(1,2,2);
normfreq(Fmin,c2)
>> figure
>> subplot(1,2,1);
boxplot(Fmax)
>> subplot(1,2,2);
boxplot(Fmin)
>> figure
>> subplot(1,3,1);
qqplot(Fmax,Fmin)
>> subplot(1,3,2);
qqplot(Fmax)
>> subplot(1,3,3);
qqplot(Fmin)
>> figure
>> scatter(Fmax,Fmin)
>> mean(x)
ans =
1.0e+003 *
5.1732
0.6331
>> cov(x)
ans =
1.0e+006 *
3.0628
0.1484
0.1484
0.0417
>> moment(x,3)
ans =
1.0e+009 *
1.5751
0.0026
>> prctile(Fmin,[10,50,90])
ans =
350.8000
638.0000
877.0000
>> prctile(Fmax,[10,50,90])
ans =
2992
5130
7412