How to generate random numbers between -pi and pi
8 次查看(过去 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!