bits of a binary input

2 vues (au cours des 30 derniers jours)
lina it
lina it le 29 Mar 2012
i have a binary user input saved in a non-cell how can i deal with each bit of that number independently ?
  1 commentaire
Jan
Jan le 29 Mar 2012
Please explain, what a "binary user input saved in a non-cell" means in valid Matlab syntax.

Connectez-vous pour commenter.

Réponses (1)

Thomas
Thomas le 29 Mar 2012
I dont know if this is what you are looking for..
c=[111111 010101 101010]
a=num2str(c)
to operate on each bit individually use
a(1) % or str2num(a(1)) and so on

Community Treasure Hunt

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

Start Hunting!

Translated by