Prof. Dr. Heinz-Willi Goelden, Fachbereich IM, FH Regensburg
Arbeitsblatt 1
Beispiel:
Die Datei „Daten“ enthält die Laufzeiten eines komplizierten iterativen Verfah- rens auf einer Workstation. Gemessen wurden für n=100 verschiedene Startwer- te die Laufzeiten, auf volle Sekunden gerundet. Es ergaben sich Werte zwischen 308 und 340 sec.
Matlab-Anweisungen
load a:\daten.txt -ascii>> daten;
>> x=daten';
>> u=308:1:340;
>> [n,xout]=hist(x,u) n =
Columns 1 through 11
0 1 2 0 0 1 1 2 1 3 1 Columns 12 through 22
1 1 2 4 3 1 6 4 3 5 8 Columns 23 through 33
6 7 9 5 8 6 5 1 2 1 0 xout =
Columns 1 through 11
308 309 310 311 312 313 314 315 316 317 318 Columns 12 through 22
319 320 321 322 323 324 325 326 327 328 329 Columns 23 through 33
330 331 332 333 334 335 336 337 338 339 340
>>N= sum(n(:)) N =
100
>> plot(xout,n)
305 310 315 320 325 330 335 340
0 1 2 3 4 5 6 7 8 9
>> hist(x,u)
305 310 315 320 325 330 335 340 345
0 1 2 3 4 5 6 7 8 9
>> u=310:4:340;
>> [n,xout]=hist(x,u) n =
3 5 6 10 18 30 24 4 xout =
310 314 318 322 326 330 334 338
>> plot(xout,n)
310 315 320 325 330 335 340
0 5 10 15 20 25 30
>> hist(x,u)
310 314 318 322 326 330 334 338
0 5 10 15 20 25 30
>> hist(x,u)/(4*N) ans =
Columns 1 through 7
0.0075 0.0125 0.0150 0.0250 0.0450 0.0750 0.0600 Column 8
0.0100
>> bar(xout,n/(4*N))
310 314 318 322 326 330 334 338
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08
>> mean(x) ans = 328.0400
>> median(x) ans =
329.5000
>> var(x) ans = 46.4024
>> std(x) ans = 6.8119