Fixed 08 octave

This commit is contained in:
NuarkNoir 2020-01-11 19:50:41 +07:00
parent aba9e0b455
commit 2fae7df017
3 changed files with 20 additions and 18 deletions

View file

@ -1,16 +1,16 @@
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
1001
0111
0011
000000
0100
0010
0001
000001
0101
1000
1011
110
1010
00001
111
0110

View file

@ -1,3 +1,5 @@
pkg load communications;
#stage 6
V=33;
rand("state", V);
@ -9,7 +11,7 @@ ralph = r./sum(r);
save -ascii "hex.txt" ralph;
#stage 8
code = arrayfun(@(n)dec2bin(n, 4), 0:15, "UniformOutput", false);
code = cellfun(@(c)char('0' + c), huffmandict(alph, ralph), 'UniformOutput', false);
dlmwrite('code.txt', char(code), '');
#stage 9

View file

@ -1 +1 @@
4.00000000e+00 3.90563513e+00 4.00000000e+00 9.76408783e-01
3.94749678e+00 3.90563513e+00 4.00000000e+00 9.89395393e-01