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 1001
0001 0111
0010 0011
0011 000000
0100 0100
0101 0010
0110 0001
0111 000001
1000 0101
1001 1000
1010 1011
1011 110
1100 1010
1101 00001
1110 111
1111 0110

View file

@ -1,3 +1,5 @@
pkg load communications;
#stage 6 #stage 6
V=33; V=33;
rand("state", V); rand("state", V);
@ -9,7 +11,7 @@ ralph = r./sum(r);
save -ascii "hex.txt" ralph; save -ascii "hex.txt" ralph;
#stage 8 #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), ''); dlmwrite('code.txt', char(code), '');
#stage 9 #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