Attachment 'zatriedovanie.txt'
Download% Zmysel nasledujuceho je priblizit pracu zatriedovania, ktoru je mozne zverit % funkcii "histc", avsak je dobre preverit, ze pracuje tak, ako predpokladame, % ze totiz zatrieduje do zlava uzavretych (sprava otvorenych) podintervalov. % Generujme data ako vektor "x" a nech vektor "ht" predstavuje hranice tried. % Aby generovane data boli totozne s uvedenymi, pouzite prikaz: "rand('state', 0) rand('state', 0), x = rand(1, 30) x = Columns 1 through 10 0.9501 0.2311 0.6068 0.4860 0.8913 0.7621 0.4565 0.0185 0.8214 0.4447 Columns 11 through 20 0.6154 0.7919 0.9218 0.7382 0.1763 0.4057 0.9355 0.9169 0.4103 0.8936 Columns 21 through 30 0.0579 0.3529 0.8132 0.0099 0.1389 0.2028 0.1987 0.6038 0.2722 0.1988 % definujme hranice tried: ht = 0:0.2:1 ht = 0 0.2000 0.4000 0.6000 0.8000 1.0000 % pocetnosti tried mozeme ziskat funkciou "histc": pt = histc(x,ht) pt = 7 4 5 6 8 0 % preverme, ze sucet pocetnosti = rozsah suboru sum(pt) ans = 30 % OK, sedi, vsetky data su zatriedene % overme, ze zatriedenie sa deje do intervalov [ ht(i); ht(i+1) ), % t.j. do zlava uzavretych a sprava otvorenych sum(x < 0.2) ans = 7 sum( x < 0.4 ) - sum( x < 0.2 ) ans = 4 sum( x < 0.6 ) - sum( x < 0.4 ) ans = 5 sum( x < 0.8 ) - sum( x < 0.6 ) ans = 6 sum( x < 1 ) - sum( x < 0.8 ) ans = 8 % skusme to ziskat v cykle: for i = 1:5, mojept(i) = sum( x < ht(i+1) ) - sum( x < ht(i) ), end mojept = 7 mojept = 7 4 mojept = 7 4 5 mojept = 7 4 5 6 mojept = 7 4 5 6 8 % keby sme pouzili potlacenie vypisu, display by neukazoval medzivysledky ... % ale v jednoduchom cykle "for" sme dosiahli to, co robi funkcia "histc" diary off
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.- [get | view] (2008-04-25 09:01:28, 0.9 KB) [[attachment:Data-Kap1Stat.rar]]
- [get | view] (2008-04-25 09:01:28, 7.8 KB) [[attachment:Data-Kap2Stat.rar]]
- [get | view] (2008-04-25 09:01:28, 4.0 KB) [[attachment:Diary-Kap3Stat.rar]]
- [get | view] (2008-04-25 09:01:28, 174.7 KB) [[attachment:Kap1Num-RU]]
- [get | view] (2008-04-25 09:01:28, 23.5 KB) [[attachment:Kap2Stat-zadanie.doc]]
- [get | view] (2008-04-25 09:01:28, 1.9 KB) [[attachment:Mfuns-Kap3Stat]]
- [get | view] (2008-04-25 09:01:28, 5.1 KB) [[attachment:Mfuns-Kap45Stat]]
- [get | view] (2008-04-25 09:01:28, 0.6 KB) [[attachment:Mfuns-kap1S.zip]]
- [get | view] (2008-04-25 09:01:28, 174.7 KB) [[attachment:NV-K1Ur.pdf]]
- [get | view] (2008-04-25 09:01:28, 280.6 KB) [[attachment:NV-K2Ur.pdf]]
- [get | view] (2008-04-25 09:01:28, 176.0 KB) [[attachment:NV-K3Ur2.pdf]]
- [get | view] (2008-04-25 09:01:28, 198.7 KB) [[attachment:SV-kap1-RU.pdf]]
- [get | view] (2008-04-25 09:01:28, 298.7 KB) [[attachment:SV-kap2-RU.pdf]]
- [get | view] (2008-04-25 09:01:28, 316.9 KB) [[attachment:SV-kap3-RU.pdf]]
- [get | view] (2008-04-25 09:01:28, 51.0 KB) [[attachment:biceps-telo.fig]]
- [get | view] (2008-04-25 09:01:28, 15.6 KB) [[attachment:cars80.fig]]
- [get | view] (2008-04-25 09:01:28, 47.2 KB) [[attachment:cars80.jpg]]
- [get | view] (2008-04-25 09:01:28, 5.1 KB) [[attachment:nahrada.rar]]
- [get | view] (2008-04-25 09:01:28, 58.5 KB) [[attachment:t-kvantily.pdf]]
- [get | view] (2008-04-25 09:01:28, 0.5 KB) [[attachment:vkvantil.m]]
- [get | view] (2008-04-25 09:01:28, 0.1 KB) [[attachment:vmkr.m]]
- [get | view] (2008-04-25 09:01:28, 2.1 KB) [[attachment:zatriedovanie.txt]]
- [get | view] (2008-04-25 09:01:28, 1.0 KB) [[attachment:zatriedovanie.zip]]
You are not allowed to attach a file to this page.