How to generate a random decimal number between -1 and 1?
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm trying to use rand below but it is giving me [ ].
rand([-1 1]);
댓글 수: 1
Ameer Hamza
2020년 10월 29일
편집: Ameer Hamza
2020년 10월 29일
The answer here: https://www.mathworks.com/matlabcentral/answers/630328-how-to-generate-a-random-decimal-number-between-1-0-and-1-52 will also work for this question. Just use
range = [-1 1]
채택된 답변
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!