How to generate a random number that is greater than or equals to a given number

조회 수: 18 (최근 30일)
example
a=5
y=randi(number)>=a

답변 (1개)

KSSV
KSSV 2018년 3월 21일
N = 1000 ;
a = 5;
b = 100;
r = (b-a).*rand(N,1) + a;

카테고리

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