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,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