matlab_randn函数

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-29 15:42   53   0

randn
Normally distributed random numbers and arrays Syntax Y = randn(n) Y = randn(m,n) Y = randn([m n]) Y = randn(m,n,p,...) Y = randn([m n p...]) Y = randn(size(A)) randn
s = randn('state') Description
The randn function generates arrays of random numbers whose elements are normally distributed with mean 0, variance σ^2 = 1 , and standard deviation σ = 1.
Y = randn(n) returns an n-by-n matrix of random entries. An error message appears if n is not a scalar.

Y = randn(m,n) or Y = randn([m n]) returns an m-by-n matrix of random entries.

Y = randn(m,n,p,...) or Y = randn([m n p...]) generates random arrays.

Y = randn(size(A)) returns an array of random entries that is the same size as A.

randn, by itself, returns a scalar whose value changes each time it's referenced.

s = randn('state') returns a 2-element vector containing the current state of the normal generator. To change the state of the generator: randn('state',s)Resets the state to s. randn('state',0)Resets the generator to its initial state. randn('state',j)For integer j, resets the generator to its jth state. randn('state',sum(100*clock))Resets it to a different state each time.

s = randn('state')返回一个2元素的包含了当前正常generator的行向量,要改变这个gennrator: randn('state',s)重置状态到s,randn('state',0)重置状态到最开始状态,randn('state',j),对于整数j重置到第j个状态,randn('state',sum(100*clock))每次都重置到不同状态.

posted on 2015-03-30 14:13 活在迷宫 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/funnyman/p/4377936.html

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP