How do i convert a Base-2 number into Base-10?
141 views (last 30 days)
Todd Leonhardt on 23 May 2016
You can use bin2dec() to convert a binary number string to a decimal number like so:
x = bin2dec('0111');
In this case x == 7. bin2dec assumes you are dealing with non-negative integers.
If you have either the Communications Toolbox (bi2de) or Fixed-Point Designer Toolbox (bin), then there are some other options available to you as well.