MATLAB Answers

0

How do you get ten random values between -pi/2 and pi/2

Asked by Daniel Porter on 26 Mar 2019 at 9:28
Latest activity Answered by John D'Errico
on 26 Mar 2019 at 9:31
I want to get ten values for theta in the range of (-pi/2, pi/2)
How do I get these?

  0 Comments

Sign in to comment.

2 Answers

Answer by Torsten
on 26 Mar 2019 at 9:30

theta = -pi/2 + rand(10,1)*pi

  0 Comments

Sign in to comment.


Answer by John D'Errico
on 26 Mar 2019 at 9:31

Read the help for rand. (Why not do this?)
In there, you will find an explicit example of exactly how to do this.
help rand
doc rand

  0 Comments

Sign in to comment.