Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
hi,I wanted to know, how can i generate a 3 bit sequential binary vector with up to only ONE 1?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Eg: 001, 010,100
0 commentaires
Réponses (1)
John D'Errico
le 17 Août 2017
Modifié(e) : John D'Errico
le 17 Août 2017
Up to only ONE 1 means the number is any number (in decimal) from the set [0,1,2,4].
Pick an element at random from that set. Then convert to binary.
help dec2bin
1 commentaire
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!