[Matlab]Desperate help with a simple code.

How Can I generate 1,000,000 random integers with range of [5 -----> 18] in a square matrix using the randi fucntion? Thank you.

 採用された回答

Roger Stafford
Roger Stafford 2014 年 10 月 20 日
編集済み: Roger Stafford 2014 年 10 月 20 日

3 投票

M = randi([5,18],1000);

1 件のコメント

Hadi
Hadi 2014 年 10 月 20 日
Thank you so much. Can I ask you one more question? How about finding the probability of a certain number and a range of certain numbers at M?

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeRandom Number Generation についてさらに検索

タグ

質問済み:

2014 年 10 月 20 日

コメント済み:

2014 年 10 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by