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" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="bin2dec" xml:lang="en">
19 <refname>bin2dec</refname>
20 <refpurpose>convert from binary to decimal</refpurpose>
24 <synopsis>y=bin2dec(str)</synopsis>
27 <title>Arguments</title>
32 <para>a matrix of strings containing only
33 characters '1' and '0'
40 <para>a matrix of doubles, positive integer values</para>
46 <title>Description</title>
48 Given <literal>str</literal> a binary string, this function returns
49 <literal>y</literal> the decimal number whose the binary representation is
50 given by <literal>str</literal> ( <literal>y</literal> and
51 <literal>str</literal> have the same size).
55 <title>Examples</title>
56 <programlisting role="example"><![CDATA[
58 // '1010110' : is the binary representation of 86
63 // '1011011' : is the binary representation of 91
64 // '1010010' : is the binary representation of 82
65 str=['1011011'; '1010010']
69 <refsection role="see also">
70 <title>See also</title>
71 <simplelist type="inline">
73 <link linkend="base2dec">base2dec</link>
76 <link linkend="oct2dec">oct2dec</link>
79 <link linkend="hex2dec">hex2dec</link>
82 <link linkend="dec2bin">dec2bin</link>
85 <link linkend="dec2oct">dec2oct</link>
88 <link linkend="dec2hex">dec2hex</link>