Random Numbers with Gaussian and Uniform Distributions in matlab

前端 未结 6 1815
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 07:12

I want generate a number in Gaussian and Uniform distributions in matlab. I know this function randi and rand() but all of them are in normal (Gau

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 07:28

    Congrulations, you already generating pseudo-random numbers with a gaussian distribution. Normal distribution is a synonym for it.

    The only other possible interpretation I can get from your question is that you want something that has mean != 0 and/or variance != 1. To do that, simply perform mean + sqrt(var) * randn(X).

提交回复
热议问题