Path: news.mathworks.com!not-for-mail
From: "alan dinno" <alan_dinno@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Conversion of Columns into Decimals
Date: Sat, 8 Dec 2007 02:40:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 35
Message-ID: <fjd062$fjd$1@fred.mathworks.com>
References: <fjcsag$t98$1@fred.mathworks.com> <fjcu8k$mcp$1@fred.mathworks.com>
Reply-To: "alan dinno" <alan_dinno@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1197081602 15981 172.30.248.38 (8 Dec 2007 02:40:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 8 Dec 2007 02:40:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1192926
Xref: news.mathworks.com comp.soft-sys.matlab:441517


"Matt Fig" <spamanon@yahoo.com> wrote in message 
<fjcu8k$mcp$1@fred.mathworks.com>...
> "alan dinno" <alan_dinno@hotmail.com> wrote in message
> <fjcsag$t98$1@fred.mathworks.com>...
> > Hi - If matrix A contains only bits,I want a row 
vector B 
> > (with same length as size(A,2)) that contains the 
> > conversion of each column in A into Decimal.
> > 
> > Example:
> > 
> >  A =[ 1 1 0 1 0
> >       0 0 1 1 1
> >       1 1 1 0 1
> >       1 0 0 1 1 ]
> > 
> >  B=[bin2dec(A col 1),bin2dec(A col 2),bin2dec(A col 
3),...]
> > 
> > Thanks
> > alan
> 
> 
> B = bin2dec(num2str(A'))'

Matt - I used it on a big matrix and gave the error:

"??? Error using ==> bin2dec
Binary string must be 52 bits or less."

Thanks
alan