| 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.
Contact us at files@mathworks.com
