generation of random numbers inthe specified range ?

Dear Sir, can any one help me for the command in matlab to generate random numbers example i want to generate numbers in between 8.75 to 9.50 around 100 numbers [min N max]

回答 (2 件)

José-Luis
José-Luis 2012 年 11 月 5 日

0 投票

your_vals = 8.75 + (9.50 - 8.75).*rand(100,1);
Image Analyst
Image Analyst 2012 年 11 月 5 日

0 投票

Did you look up random numbers in the help, specifically the rand() function? If you do, you'll see Example 1 is what you want:
Example 1
Generate values from the uniform distribution on the interval [a, b]:
r = a + (b-a).*rand(100,1);

カテゴリ

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

タグ

タグが未入力です。

質問済み:

2012 年 11 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by