bin2dec
Convert a binary string to a decimal number.
Syntax
Section titled “Syntax”v = bin2dec(b)Description
Section titled “Description”Parses b (a string of 0s and 1s, up to 10 bits) as a binary number and returns its decimal value. Two’s-complement negative encoding when the leading bit is set.
Examples
Section titled “Examples”bin2dec('1100100') % 100bin2dec('1111111111') % -1 (two's complement)