フィルターのクリア

Hi,,is there anyone who could tell me,how to generate a 10 bit binary data with only ONE in the first position and rest is zero?

1 回表示 (過去 30 日間)
The data stream should be like this, A=[1 0 0 0 0 0 0 0 0 0]

採用された回答

Star Strider
Star Strider 2016 年 5 月 20 日
If you want to be compatible with the MATLAB binary data representation convention, this works:
n = dec2bin(0, 10);
n(1) = '1';

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 5 月 20 日
編集済み: Azzi Abdelmalek 2016 年 5 月 20 日
A=[1 zeros(1,9)]
or
dec2bin(2^9,10)-'0'

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by