bit reversal in a Vector

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??

 採用された回答

Matt J
Matt J 2012 年 12 月 25 日

1 投票

a(2)=~a(2);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2012 年 12 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by