Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.1 - Français

Change language to:
English - 日本語 - Português

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

Aide Scilab >> Fonctions Elémentaires > Représentation d'entier > bin2dec

bin2dec

integer corresponding to a binary form

Calling Sequence

y=bin2dec(str)

Arguments

str

a string or a vector/matrix of strings containing only characters '1' and '0'

y

a scalar or a vector/matrix of positives integers

Description

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

Examples

// example 1 :
// '1010110' : is the binary representation of 86 
str='1010110';
y=bin2dec(str)

// example 2 :
// '1011011' : is the binary representation of 91 
// '1010010' : is the binary representation of 82
str=['1011011'; '1010010']
y=bin2dec(str)

See Also

  • base2dec — conversion from base b representation to integers
  • oct2dec — conversion from octal representation to integers
  • hex2dec — conversion from hexadecimal representation to integers
  • dec2bin — binary representation
  • dec2oct — octal representation of integers
  • dec2hex — représentation hexadécimale d'un entier
<< base2dec Représentation d'entier dec2bin >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Mar 03 11:00:02 CET 2011