Navigation

Operators and Keywords

Function List:

C++ API

: bin2dec (s)

Return the decimal number corresponding to the binary number represented by the string s.

For example:

bin2dec ("1110")
     ⇒ 14

Spaces are ignored during conversion and may be used to make the binary number more readable.

bin2dec ("1000 0001")
     ⇒ 129

If s is a string matrix, return a column vector with one converted number per row of s; Invalid rows evaluate to NaN.

If s is a cell array of strings, return a column vector with one converted number per cell element in s.

See also: dec2bin, base2dec, hex2dec.

Package: octave