How to generate random numbers between -pi and pi
조회 수: 7 (최근 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!