Effacer les filtres
Effacer les filtres

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)
nafila aytija
nafila aytija le 17 Août 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021
Eg: 001, 010,100

Réponses (1)

John D'Errico
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

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by