フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

hi,I wanted to know, how can i generate a 3 bit sequential binary vector with up to only ONE 1?

1 回表示 (過去 30 日間)
nafila aytija
nafila aytija 2017 年 8 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Eg: 001, 010,100

回答 (1 件)

John D'Errico
John D'Errico 2017 年 8 月 17 日
編集済み: John D'Errico 2017 年 8 月 17 日
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

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by