MATLAB Answers

0

how can replace randi instead randint?

Asked by long zhang on 24 Aug 2019 at 2:18
Latest activity Commented on by Star Strider
on 24 Aug 2019 at 11:25
QQ图片20190824101224.png
I need help ,please!

  0 Comments

Sign in to comment.

1 Answer

Answer by Star Strider
on 24 Aug 2019 at 3:02

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 Comments

Walter Roberson
on 24 Aug 2019 at 4:04
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
on 24 Aug 2019 at 11:25
@Walter — Thank you!
I don’t have the Communications Toolbox, so I have no experience with it.

Sign in to comment.