How to generate random numbers between -pi and pi
15 ビュー (過去 30 日間)
古いコメントを表示
Hi,
i tried generating numbers with linspace(-pi,pi) and i get somewhat the correct numbers. But only for the first run of course. I need random values between -pi and pi for several runs, and all should be other numbers. the rand() function doesnt work with pi
0 件のコメント
採用された回答
dpb
2016 年 4 月 8 日
help rand
...
Example 1: Generate values from the uniform distribution on the interval [a, b].
r = a + (b-a).*rand(100,1);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!