Path: news.mathworks.com!not-for-mail
From: "Steve Amphlett" <Firstname.Lastname@Where-I-Work.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: count number of
Date: Wed, 30 Jul 2008 17:50:18 +0000 (UTC)
Organization: Ricardo UK Ltd
Lines: 19
Message-ID: <g6q9kq$log$1@fred.mathworks.com>
References: <g6ptlp$sfm$1@fred.mathworks.com> <2748437.1217439315576.JavaMail.jakarta@nitrogen.mathforum.org>
Reply-To: "Steve Amphlett" <Firstname.Lastname@Where-I-Work.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1217440218 22288 172.30.248.37 (30 Jul 2008 17:50:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 30 Jul 2008 17:50:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 43398
Xref: news.mathworks.com comp.soft-sys.matlab:482703



bogfrog <jmcgraw@rcn.com> wrote in message 
<2748437.1217439315576.JavaMail.jakarta@nitrogen.mathforum.o
rg>...
> > If you're doing this many times in a loop you should
> > try of
> > the solutions here and see which one is fastest. I
> > had come
> > up with an alternate method of 
> > 
> > s=sum(dec2bin(d)=='1') but on my computer the method
> > i
> > posted above is about twice as fast.
> 
> I ended up writing it in C and using a mex file.  
Everything in matlab was just too slow.
> 
> Thanks, though.

Gonna share??