Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
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