Random secuence {-3,-1,1,3}

Hi All, how can I build a random secuence to obtain this values {-3,-1,1,3}?

回答 (1 件)

Rick Rosson
Rick Rosson 2014 年 10 月 22 日
編集済み: Rick Rosson 2014 年 10 月 22 日

0 投票

x = 2*randi([0 3],100,1) - 3;

カテゴリ

ヘルプ センター および File ExchangeRandom Number Generation についてさらに検索

タグ

質問済み:

2014 年 10 月 22 日

編集済み:

2014 年 10 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by