Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - Português

Change language to:
English - Français - 日本語 -

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

Manual Scilab >> Funções Elementares > Integer representation > bin2dec

bin2dec

conversão de representação binária para inteira

Seqüência de Chamamento

y=bin2dec(str)

Parâmetros

str

um string ou vetor/matriz de strings contendo apenas caracteres '1' e '0'

y

um escalar ou um vetor/matriz de inteiros positivos

Descrição

Dado str um string binário, está função retorna y, o número decimal cuja representação binária é dada por str ( y e str possuem o mesmo tamanho)

Exemplos

// example 1 :
// '1010110' : é a representação binária de 86 
str='1010110';
y=bin2dec(str)

// example 2 :
// '1011011' : é a representação binária de 91 
// '1010010' : é a representação binária de 82
str=['1011011'; '1010010']
y=bin2dec(str)
<< base2dec Integer representation dec2bin >>

Copyright (c) 2022-2023 (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:
Wed Jan 26 16:24:34 CET 2011