how can replace randi instead randint?

5 ビュー (過去 30 日間)
long zhang
long zhang 2019 年 8 月 24 日
コメント済み: Star Strider 2019 年 8 月 24 日
QQ图片20190824101224.png
I need help ,please!

回答 (1 件)

Star Strider
Star Strider 2019 年 8 月 24 日
The appropriate Release Notes for R2016b says simply:
‘Replace all instances of randint with randi.’
According to this Answer, randi is simply randint with the order of the arguments changed.
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 8 月 24 日
That particular use of randint() is a bit unusual. It would translate to
rng(123);
sts_seq = randi([0 1], 1, length(SC_Position)/2) .* 2 - 1;
With 0 or 1 being multiplied by 2 and add 1, then the results would be either -1 or +1.
Star Strider
Star Strider 2019 年 8 月 24 日
@Walter — Thank you!
I don’t have the Communications Toolbox, so I have no experience with it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by