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

8 ビュー (過去 30 日間)
Bashir Yusuf Bichi
Bashir Yusuf Bichi 2018 年 3 月 21 日
編集済み: James Tursa 2018 年 3 月 21 日
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 Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by