Convert from binary to decimal (original) (raw)

Please note that the recommended version of Scilab is 2026.0.1. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Elementary Functions > Integer representation > bin2dec

bin2dec

convert from binary to decimal

Calling Sequence

Arguments

str

a matrix of strings containing only characters '1' and '0'

y

a matrix of doubles, positive integer values

Description

Given str a binary string, this function returnsy the decimal number whose the binary representation is given by str ( y andstr have the same size).

Examples

str='1010110'; y=bin2dec(str)

str=['1011011'; '1010010'] y=bin2dec(str)

See Also