how to create random double in specific range?
이전 댓글 표시
HI, randi function Can only generate integers in specific range.
num = randi([1,3],[1,10],'double');
how to create double numbers in range such as [0.2,1.2]?
채택된 답변
추가 답변 (1개)
Carolina Escobar
2023년 4월 1일
0 개 추천
e = rand(0.1,1)
댓글 수: 1
This will throw an error.
e = rand(0.1, 1)
As the error message indicates, the size inputs to rand must contain integer values.
카테고리
도움말 센터 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!