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

4 ビュー (過去 30 日間)
Daniel Porter
Daniel Porter 2019 年 3 月 26 日
回答済み: John D'Errico 2019 年 3 月 26 日
I want to get ten values for theta in the range of (-pi/2, pi/2)
How do I get these?

回答 (2 件)

Torsten
Torsten 2019 年 3 月 26 日
theta = -pi/2 + rand(10,1)*pi

John D'Errico
John D'Errico 2019 年 3 月 26 日
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

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by