フィルターのクリア

generate random number in between two numbers?

1 回表示 (過去 30 日間)
Mudasir Ahmed
Mudasir Ahmed 2015 年 8 月 8 日
コメント済み: Mudasir Ahmed 2015 年 8 月 8 日
hi
i have two numbers e.g [5,10]. or [17 7]. how we can generate random numbers in between these ranges. in e.g [5 10], 8 will be randomly generated. and in e.g [17 7], may be 10 number will be generated.
Note: [5 10] means [5 6 7 8 9 10]
[17 7] means [17 16 15 14 13 12 11 10 9 8 7]
kindly help me

採用された回答

Stalin Samuel
Stalin Samuel 2015 年 8 月 8 日
randi([5 10],1,5)
  3 件のコメント
Walter Roberson
Walter Roberson 2015 年 8 月 8 日
randi(sort(TheRange),1,NumberToGenerate)
Mudasir Ahmed
Mudasir Ahmed 2015 年 8 月 8 日
Thanks again sir :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by