| MATLAB Central > MATLAB Newsreader > count number of "on" bits? |
|
|
|
How would I do a bitcount in matlab? |
|
d=17465765 |
|
> d=17465765 |
|
Subject: count number of "on" bits? From: Yumnam Kirani Singh Date: 30 Jul, 2008 04:56:13 Message: 4 of 15 |
|
You can use length and find fucntions to solve your problem. |
|
> d=17465765 |
|
On Jul 30, 5:57=A0am, bogfrog <jmcg...@rcn.com> wrote: |
|
bogfrog <jmcgraw@rcn.com> wrote in message |
|
bogfrog: |
|
bogfrog <jmcgraw@rcn.com> wrote in message |
|
> If you're doing this many times in a loop you should |
|
bogfrog <jmcgraw@rcn.com> wrote in message |
|
> Gonna share?? |
|
> Gonna share?? |
|
I prefer the following (which I didn't spot): |
|
The following times are those to count the bits in all 4 billion 32-bit integers on 64-bit ubuntu linux. |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
E-mail this page to a colleague
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Contact us at files@mathworks.com