So I am writing a script to convert a number from base 10 to base 2. I have written my own script, but I had trouble using dec2base. The function does not seem to work when I write something like
(i = dec2base(4, 2); and also fprintf('%g', i))
It outputs 494848. However, if I simply write dec2base(4, 2) without a semicolon the operation works, but the format is wrong.
Best Answer