<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576</link>
    <title>MATLAB Central Newsreader - Conversion of Columns into Decimals</title>
    <description>Feed for thread: Conversion of Columns into Decimals</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 10 Dec 2007 18:27:41 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405543</link>
      <author>Bruno Luong</author>
      <description>"Roger Stafford" &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt;&lt;br&gt;
wrote in message &amp;lt;fjjta0$2ev$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Steven Lord" &amp;lt;slord@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fji99i$70c&lt;br&gt;
&amp;gt; $1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "Roger Stafford"&lt;br&gt;
&amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
&amp;gt; &amp;gt; message news:fjdfur$npn$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ........&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; [m,n] = size(A);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; B=sum(repmat(2.^(m-1:-1:0)',1,n).*A,1);&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Another way to write the above is:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; A = round(rand(7, 10)); % Sample data&lt;br&gt;
&amp;gt; &amp;gt; v = ((size(A, 2)-1):-1:0).';&lt;br&gt;
&amp;gt; &amp;gt; B = A*2.^v&lt;br&gt;
&amp;gt; &amp;gt; B - bin2dec(num2str(A)) % Should be all zeros&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Steve Lord&lt;br&gt;
&amp;gt; &amp;gt; slord@mathworks.com &lt;br&gt;
&amp;gt; ---------&lt;br&gt;
&amp;gt; Hello Steve,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   It is my understanding that Alan Dinno wants to convert&lt;br&gt;
the columns, not &lt;br&gt;
&amp;gt; the rows, of binary array A to a row of the corresponding&lt;br&gt;
numerical &lt;br&gt;
&amp;gt; quantities, in the manner that Matt has suggested using&lt;br&gt;
the 'bin2dec' &lt;br&gt;
&amp;gt; function.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   However, Alan has subsequently stated that he received&lt;br&gt;
an error message &lt;br&gt;
&amp;gt; from the 'bin2dec' function to the effect that it requires&lt;br&gt;
a bit string length of &lt;br&gt;
&amp;gt; no more than 52 bits, which would imply that his A arrays&lt;br&gt;
possess more than &lt;br&gt;
&amp;gt; that number of rows.  Based on this, the code I sent him&lt;br&gt;
was intended to &lt;br&gt;
&amp;gt; overcome this obstacle, though past 53 bits the results&lt;br&gt;
necessarily become &lt;br&gt;
&amp;gt; subject to possible roundoff error.  Has 'bin2dec' been&lt;br&gt;
upgraded in more &lt;br&gt;
&amp;gt; recent matlab versions than Alan's so as to allow more&lt;br&gt;
than 52 bits input?&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Does he needs to sum of bits from 53th position? May be he&lt;br&gt;
just has to through them out and use hex2dec.&lt;br&gt;
&lt;br&gt;
I would like Mathworks to add a similar function hex2int or&lt;br&gt;
extend the hex2dec() with optional flag for setting output&lt;br&gt;
class. Once I wanted to convert hexa string to integer (16,&lt;br&gt;
or 32), hex2dec is no good to scope with overflow and sign,&lt;br&gt;
and it's pretty slow. I ended up doing a small C-mex file&lt;br&gt;
with sscanf(... '%x').&lt;br&gt;
&lt;br&gt;
Bruno&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 10 Dec 2007 17:33:52 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405535</link>
      <author>Roger Stafford</author>
      <description>"Steven Lord" &amp;lt;slord@mathworks.com&amp;gt; wrote in message &amp;lt;fji99i$70c&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Roger Stafford" &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
&amp;gt; message news:fjdfur$npn$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt; ........&lt;br&gt;
&amp;gt; &amp;gt; [m,n] = size(A);&lt;br&gt;
&amp;gt; &amp;gt; B=sum(repmat(2.^(m-1:-1:0)',1,n).*A,1);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Another way to write the above is:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A = round(rand(7, 10)); % Sample data&lt;br&gt;
&amp;gt; v = ((size(A, 2)-1):-1:0).';&lt;br&gt;
&amp;gt; B = A*2.^v&lt;br&gt;
&amp;gt; B - bin2dec(num2str(A)) % Should be all zeros&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Steve Lord&lt;br&gt;
&amp;gt; slord@mathworks.com &lt;br&gt;
---------&lt;br&gt;
Hello Steve,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;It is my understanding that Alan Dinno wants to convert the columns, not &lt;br&gt;
the rows, of binary array A to a row of the corresponding numerical &lt;br&gt;
quantities, in the manner that Matt has suggested using the 'bin2dec' &lt;br&gt;
function.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;However, Alan has subsequently stated that he received an error message &lt;br&gt;
from the 'bin2dec' function to the effect that it requires a bit string length of &lt;br&gt;
no more than 52 bits, which would imply that his A arrays possess more than &lt;br&gt;
that number of rows.  Based on this, the code I sent him was intended to &lt;br&gt;
overcome this obstacle, though past 53 bits the results necessarily become &lt;br&gt;
subject to possible roundoff error.  Has 'bin2dec' been upgraded in more &lt;br&gt;
recent matlab versions than Alan's so as to allow more than 52 bits input?&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 10 Dec 2007 02:46:10 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405417</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
"Roger Stafford" &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
message news:fjdfur$npn$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd710$73p&lt;br&gt;
&amp;gt; $1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Will it be possible if vector B contained only integers?&lt;br&gt;
&amp;gt;&amp;gt; Thanks&lt;br&gt;
&amp;gt;&amp;gt; alan&lt;br&gt;
&amp;gt; --------&lt;br&gt;
&amp;gt;  No, even with "double" integers, starting with the integer, 2^53+1, one&lt;br&gt;
&amp;gt; encounters values which cannot be represented exactly by IEEE double&lt;br&gt;
&amp;gt; precision floating point numbers.  Use format hex and try to add 1 to &lt;br&gt;
&amp;gt; 2^53.&lt;br&gt;
&amp;gt; You will see that the result will still be 2^53.  Any integer, which in &lt;br&gt;
&amp;gt; binary&lt;br&gt;
&amp;gt; would span more than 53 bits between its highest and lowest 1-bits, is&lt;br&gt;
&amp;gt; impossible to represent in the "double" format.  In particular, the &lt;br&gt;
&amp;gt; integer&lt;br&gt;
&amp;gt; 2^53+1 in binary would be an impossible 54 bits long with a 1-bit at each&lt;br&gt;
&amp;gt; end.  There are simply not enough bits available in the 64-bit IEEE format &lt;br&gt;
&amp;gt; to&lt;br&gt;
&amp;gt; accomplish that.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;  Of course, it would be possible to carry out the desired conversion if &lt;br&gt;
&amp;gt; you&lt;br&gt;
&amp;gt; were willing to accept approximate "double" answers.  The following should&lt;br&gt;
&amp;gt; accomplish that:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; [m,n] = size(A);&lt;br&gt;
&amp;gt; B=sum(repmat(2.^(m-1:-1:0)',1,n).*A,1);&lt;br&gt;
&lt;br&gt;
Another way to write the above is:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
A = round(rand(7, 10)); % Sample data&lt;br&gt;
v = ((size(A, 2)-1):-1:0).';&lt;br&gt;
B = A*2.^v&lt;br&gt;
B - bin2dec(num2str(A)) % Should be all zeros&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 07:09:15 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405260</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd710$73p&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Will it be possible if vector B contained only integers?&lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;No, even with "double" integers, starting with the integer, 2^53+1, one &lt;br&gt;
encounters values which cannot be represented exactly by IEEE double &lt;br&gt;
precision floating point numbers.  Use format hex and try to add 1 to 2^53.  &lt;br&gt;
You will see that the result will still be 2^53.  Any integer, which in binary &lt;br&gt;
would span more than 53 bits between its highest and lowest 1-bits, is &lt;br&gt;
impossible to represent in the "double" format.  In particular, the integer &lt;br&gt;
2^53+1 in binary would be an impossible 54 bits long with a 1-bit at each &lt;br&gt;
end.  There are simply not enough bits available in the 64-bit IEEE format to &lt;br&gt;
accomplish that.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Of course, it would be possible to carry out the desired conversion if you &lt;br&gt;
were willing to accept approximate "double" answers.  The following should &lt;br&gt;
accomplish that:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;[m,n] = size(A);&lt;br&gt;
&amp;nbsp;B=sum(repmat(2.^(m-1:-1:0)',1,n).*A,1);&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 04:36:48 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405251</link>
      <author>alan dinno</author>
      <description>"Roger Stafford" &lt;br&gt;
&amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fjd1sg$6nm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fjd062$fjd&lt;br&gt;
&amp;gt; $1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in &lt;br&gt;
message&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; &amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A &lt;br&gt;
col &lt;br&gt;
&amp;gt; &amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; &amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; --------&lt;br&gt;
&amp;gt;   If vector B is to consist of double precison floating &lt;br&gt;
point numbers (double), &lt;br&gt;
&amp;gt; these are capable of representing integers to only 53 &lt;br&gt;
bits of precision, since &lt;br&gt;
&amp;gt; that is the number of bits in their significands.  The &lt;br&gt;
remaining bits of the 64 &lt;br&gt;
&amp;gt; are needed for sign and exponent.  If the columns of A &lt;br&gt;
are longer than that, &lt;br&gt;
&amp;gt; your desired task is therefore impossible, in general, &lt;br&gt;
if you want exact &lt;br&gt;
&amp;gt; representation, and presumably that is why 'bin2dec' &lt;br&gt;
complained.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Will it be possible if vector B contained only integers?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
alan&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:17:14 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405249</link>
      <author>Roger Stafford</author>
      <description>Sorry for the eight repetitions of my response.  There seems to be a problem &lt;br&gt;
with MathWorks' Newsreader.  On my first click on the "Post Message" button it &lt;br&gt;
suffered a Gateway timeout after two or three minutes.  On the second click it &lt;br&gt;
finally was entered after over a minute but that resulted in the eight identical &lt;br&gt;
copies.  The same thing also happened a few days ago in another thread.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:09:04 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405248</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:08:50 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405247</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:08:48 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405246</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:07:35 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405245</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:07:28 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405244</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:07:25 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405242</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:07:25 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405243</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 03:03:34 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405241</link>
      <author>Roger Stafford</author>
      <description>"alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message &amp;lt;fjd062$fjd&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
&amp;gt; vector B &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
&amp;gt; 3),...]&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "??? Error using ==&amp;gt; bin2dec&lt;br&gt;
&amp;gt; Binary string must be 52 bits or less."&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; alan&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If vector B is to consist of double precison floating point numbers (double), &lt;br&gt;
these are capable of representing integers to only 53 bits of precision, since &lt;br&gt;
that is the number of bits in their significands.  The remaining bits of the 64 &lt;br&gt;
are needed for sign and exponent.  If the columns of A are longer than that, &lt;br&gt;
your desired task is therefore impossible, in general, if you want exact &lt;br&gt;
representation, and presumably that is why 'bin2dec' complained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Dec 2007 02:40:02 -0500</pubDate>
      <title>Re: Conversion of Columns into Decimals</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160576#405240</link>
      <author>alan dinno</author>
      <description>"Matt Fig" &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fjcu8k$mcp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "alan dinno" &amp;lt;alan_dinno@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fjcsag$t98$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi - If matrix A contains only bits,I want a row &lt;br&gt;
vector B &lt;br&gt;
&amp;gt; &amp;gt; (with same length as size(A,2)) that contains the &lt;br&gt;
&amp;gt; &amp;gt; conversion of each column in A into Decimal.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Example:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;  A =[ 1 1 0 1 0&lt;br&gt;
&amp;gt; &amp;gt;       0 0 1 1 1&lt;br&gt;
&amp;gt; &amp;gt;       1 1 1 0 1&lt;br&gt;
&amp;gt; &amp;gt;       1 0 0 1 1 ]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col &lt;br&gt;
3),...]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; alan&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; B = bin2dec(num2str(A'))'&lt;br&gt;
&lt;br&gt;
Matt - I used it on a big matrix and gave the error:&lt;br&gt;
&lt;br&gt;
"??? Error using ==&amp;gt; bin2dec&lt;br&gt;
Binary string must be 52 bits or less."&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
alan&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
