How to generate random numbers?

조회 수: 11 (최근 30일)
Raja R
Raja R 2016년 5월 6일
편집: Azzi Abdelmalek 2016년 5월 6일
I wan random number in the range of 10 to 50 but with two decimals of size 1X5
Eg:[10 10.25 13 14.25 45.63] It may be any random numbers

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 6일
편집: Azzi Abdelmalek 2016년 5월 6일
l1=10;
l2=50;
out=l1+(l2-l1)*rand(1,5);
out=round(out*100)/100

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by