1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA
5 * Copyright (C) 2011 - DIGITEO - Michael Baudin
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises
9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
11 * This file was originally licensed under the terms of the CeCILL v2.1,
12 * and continues to be available under such terms.
13 * For more information, see the COPYING file which you should have received
14 * along with this program.
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
19 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
20 xmlns:scilab="http://www.scilab.org" xml:id="bin2dec" xml:lang="en">
22 <refname>bin2dec</refname>
23 <refpurpose>convert from binary to decimal</refpurpose>
27 <synopsis>y=bin2dec(str)</synopsis>
30 <title>Arguments</title>
35 <para>a matrix of strings containing only
36 characters '1' and '0'
43 <para>a matrix of doubles, positive integer values</para>
49 <title>Description</title>
51 Given <literal>str</literal> a binary string, this function returns
52 <literal>y</literal> the decimal number whose the binary representation is
53 given by <literal>str</literal> ( <literal>y</literal> and
54 <literal>str</literal> have the same size).
58 <title>Examples</title>
59 <programlisting role="example"><![CDATA[
61 // '1010110' : is the binary representation of 86
66 // '1011011' : is the binary representation of 91
67 // '1010010' : is the binary representation of 82
68 str=['1011011'; '1010010']
72 <refsection role="see also">
73 <title>See also</title>
74 <simplelist type="inline">
76 <link linkend="base2dec">base2dec</link>
79 <link linkend="oct2dec">oct2dec</link>
82 <link linkend="hex2dec">hex2dec</link>
85 <link linkend="dec2bin">dec2bin</link>
88 <link linkend="bitstring">bitstring</link>