bit reversal in a Vector

1 view (last 30 days)
Sadia
Sadia on 25 Dec 2012
i want to take a NOT of one bit in a vector and then restore that bit in the same vector.e.g.
a=[0 1 1 0]
what i need is:
a=[0 0 1 0]
Any ideas??

Accepted Answer

Matt J
Matt J on 25 Dec 2012
a(2)=~a(2);

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!