values of randi function repeat themselves
3 ビュー (過去 30 日間)
古いコメントを表示
while using the function randi that generate random integers uniformly disterbuted i sometimes get in the output vector the same numbers for example:
4 2 5 3 4 8 7 9 7 4
(the number 4 was three times in the row above)
how can i avoid this?
locTX=randi([1 20],1,4);
0 件のコメント
採用された回答
Azzi Abdelmalek
2014 年 8 月 30 日
編集済み: Azzi Abdelmalek
2014 年 8 月 30 日
4 件のコメント
Image Analyst
2014 年 8 月 31 日
rand() and randi() are uniform. randn() is normally/Gaussian distributed. You might want to edit your post (body and subject line) to get rid of randni to avoid confusing people with a function that you say you don't use.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!