how to code 8 boolean variables inside a unit8
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone,
I have to code 8 boolean variables inside a 8 bit word, I should return as result an unsigned integer of 8 bit e.g.:
unit8 wordVAR;
boolean IN0;
boolean IN1;
....................
and then
8bit 7 6 5 4 3 2 1 0
wordVAR= IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
I should do that because my internship advisor want it
is there a way to do that using a matlab instruction or a C Lv2 sfunction ?
thanks a lot 4 reading
0 commentaires
Réponse acceptée
Walter Roberson
le 3 Mai 2012
You can use bitset() but it has never been clear that bitset is any faster than using arithmetic.
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Parallel Computing Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!