normrnd vs.random
古いコメントを表示
Dear, I would like to generate random nmbers with a normal distribution. From the documentation I see that there are two functioncs that seem to make the same things. normrnd(mu,sigma) and random('Normal',mu,sigma)
I wrote these two simpole for-loop in order to evaluate time consumption of these two functions and I found that normrnd is less time-consuming than random. I don't understand this difference. Could you help me?
tic for i=1:1000000 ciao=ciao+normrnd(0,0.01); end toc
tic for i=1:1000000 ciao=ciao+random('Normal',0,0.01); end toc
Kind regards
Andrea Giostri
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Climate Science and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!