octave 06 and 08WIP
This commit is contained in:
parent
e9d7aa3900
commit
c3777e550b
15 changed files with 303 additions and 0 deletions
17
1sem/octave/08/decode_msg.m
Normal file
17
1sem/octave/08/decode_msg.m
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
## Author: nuark <nuark@DESKTOP-MJTVANB>
|
||||
## Created: 2019-12-08
|
||||
|
||||
function msg = decode_msg(emsg, code)
|
||||
alph = ['0':'9' 'A':'F'];
|
||||
msg = '';
|
||||
word = '';
|
||||
|
||||
for c = emsg
|
||||
word(end + 1) = c;
|
||||
match = strcmp(code, word);
|
||||
if any(match)
|
||||
msg = strcat(msg, alph(match));
|
||||
word = '';
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue