1sem, 7 work in octave
This commit is contained in:
parent
3038462693
commit
b68323cca1
5 changed files with 127 additions and 0 deletions
6
1sem/octave/07/read_num_code.m
Normal file
6
1sem/octave/07/read_num_code.m
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
function [n] = read_num_code(s)
|
||||
n = bin2dec(s);
|
||||
if s(1) == '1'
|
||||
n -= 2^length(s);
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue