bit flipping
25 次查看(过去 30 天)
显示 更早的评论
[EDIT: Thu May 12 23:15:24 UTC 2011 Duplicate Removed - MKF]
a=[0 1 1 0 1 0 1 0 1 0 1 1 1 1 ................]=30 bits how to flip it by 6 bits
1 个评论
Paulo Silva
2011-4-24
I'm not familiar with the bit flipping concept, can you give one example or provide more information?
采纳的回答
Paulo Silva
2011-4-24
@Walter
I was waiting for mahaveer to show some effort :(
Just for the record here's my code:
c=[1 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1]
nbflip=6; %flip 6 bits
v=nbflip:nbflip:numel(c); %make a vector with all the index values of c to flip
c(v)=not(c(v)); %flip the bits
0 个评论
更多回答(2 个)
mahaveer hanuman
2011-4-24
1 个评论
Paulo Silva
2011-4-24
Ok now I understand but please don't accept your own answer because it ain't the solution for the problem.
I made the code but I wan't to be sure that you tried to solve the problem so I ask what have you done so far in order to solve the problem?
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!