Professional Documents
Culture Documents
Menggunakan Matlab
Achmad Basuki
2004
Materi
• Plot
• Histogram
• PDF
• CDF
• Analisa Data
x(n)
PLOT
Menampilkan semua bilangan acak
n
>> x=rand(1,8)
x=
Columns 1 through 3
0.4387 0.4983 0.2140
Columns 4 through 6
0.6435 0.3200 0.9601
Columns 7 through 8
0.7266 0.4120
>> plot(x),grid
>>
H(x)
Histogram
Menampilkan histogram dari bilangan acak
x
>> x=floor(rand(1,15)*10)
x= 3
7 2 4 9 6 2 2
8 6 1 2 6 6
1
Columns 13 through 15
3 5 4 0.5
>> t=0:9; 0
0 1 2 3 4 5 6 7 8 9
>> h=hist(x,t);
>> bar(t,h), grid
PDF p( xi ) =
H ( xi )
p(x)
Menampilkan fungsi kepadatan
∑ H (x )
n
probabilitas (probability density j
function) dari bilangan acak j =1 x
>> x=floor(10*rand(1,16))
x=
Columns 1 through 6
6 7 6 0 4 4
Columns 7 through 12
3 1 6 6 7 4
Columns 13 through 16
5 1 4 7
>> t=0:9;
>> h=hist(x,t);
>> p=h/sum(h);
>> plot(t,p,'o:'),grid
CDF k
c(x)
c( xk ) = ∑ p( xi )
Menampilkan fungsi kepadatan
kumulatif (cumulative density
i =1
function) dari bilangan acak
x
>> x=floor(10*rand(1,16))
x=
1
Columns 1 through 6
0.9
6 7 6 0 4 4
0.8
Columns 7 through 12
0.7
3 1 6 6 7 4
Columns 13 through 16 0.6
5 1 4 7 0.5
0.09
0.08
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
0 10 20 30 40 50 60 70 80 90 100
Tugas 2