error message "you might need a Statistics and Machine Learning Toolbox"

4 ビュー (過去 30 日間)
cgo
cgo 2016 年 1 月 12 日
コメント済み: cgo 2016 年 1 月 12 日
I am using the following function in two computers,
random('Normal',0,100,nstates,nactions)
This generates a random numbers from 0 to 100 in a Normal Distribution in an nstates x nactions matrix.
Thing is, I do not have a Statistics and Machine Learning toolbox in my other computer so it returns an error message. Can I write my own function for this?
Thanks

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 1 月 12 日
That does not generate random numbers from 0 to 100. It generals random numbers with mean 0 and standard deviation 100. The non-toolbox equivalent is
randn(nstates,nactions) * 100 + 0
  1 件のコメント
cgo
cgo 2016 年 1 月 12 日
I stand corrected. Thanks for your help.

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

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by