how to draw random numbers from the vector
古いコメントを表示
Hi, i have drawn a distribution based on on the generated vector of random numbers.
My question is:
- how to draw randomly 10 numbers, and , therefore, 10 values of that distribution.
- if it's impossible to find the values of this distribtution, how to simply draw 10 random numbers from , for example, vector of 1000 numbers.
Thanks.
採用された回答
その他の回答 (1 件)
José-Luis
2014 年 3 月 19 日
doc ranperm
x = rand(1000,1); %could be any other distribution, please see documentation
1.
rand(10,1); %smaller sample from the same distrubution
2.
your_vals = x(randperm(1000,10)); %ten numbers from the first sample
カテゴリ
ヘルプ センター および File Exchange で Random Number Generation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!