免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
最新分享
MATLAB 中的randn函數(shù)
matlab函數(shù)randn:產(chǎn)生正態(tài)分布的隨機(jī)數(shù)或矩陣的函數(shù)
randn
產(chǎn)生均值為0,方差 σ^2 = 1,標(biāo)準(zhǔn)差σ = 1的正態(tài)分布的隨機(jī)數(shù)或矩陣的函數(shù)。

用法:
Y = randn(n)
返回一個(gè)n*n的隨機(jī)項(xiàng)的矩陣。如果n不是個(gè)數(shù)量,將返回錯(cuò)誤信息。
Y = randn(m,n) 或 Y = randn([m n])
返回一個(gè)m*n的隨機(jī)項(xiàng)矩陣。
Y = randn(m,n,p,...) 或 Y = randn([m n p...])
產(chǎn)生隨機(jī)數(shù)組。
Y = randn(size(A))
返回一個(gè)和A有同樣維數(shù)大小的隨機(jī)數(shù)組。
randn
返回一個(gè)每次都變化的數(shù)量。

s = randn('state')

舉例

Example 1. R = randn(3,4) 將生成矩陣

R =
1.1650 0.3516 0.0591 0.8717
0.6268 -0.6965 1.7971 -1.4462
0.0751 1.6961 0.2641 -0.7012
For a histogram of the randn distribution, see hist.

Example 2. 產(chǎn)生一個(gè)隨機(jī)分布的指定均值和方差的矩陣:將randn產(chǎn)生的結(jié)果乘以標(biāo)準(zhǔn)差,然后加上期望均值即可。例如,產(chǎn)生均值為0.6,方差為0.1的一個(gè)5*5的隨機(jī)數(shù)方式如下:

x = .6 + sqrt(0.1) * randn(5)
x =
0.8713 0.4735 0.8114 0.0927 0.7672
0.9966 0.8182 0.9766 0.6814 0.6694
0.0960 0.8579 0.2197 0.2659 0.3085
0.1443 0.8251 0.5937 1.0475 -0.0864
0.7806 1.0080 0.5504 0.3454 0.5813
其他類似函數(shù):rand, randperm, sprand, sprandn

-------------------------------------------------------------
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.ExamplesExample 1. R = randn(3,4) may produce   R =
1.1650 0.3516 0.0591 0.8717
0.6268 -0.6965 1.7971 -1.4462
0.0751 1.6961 0.2641 -0.7012
For a histogram of the randn distribution, see hist. Example 2. Generate a random distribution with a specific mean and variance . To do this, multiply the output of randn by the standard deviation , and then add the desired mean. For example, to generate a 5-by-5 array of random numbers with a mean of .6 that are distributed with a variance of 0.1 x = .6 + sqrt(0.1) * randn(5)
x =
0.8713 0.4735 0.8114 0.0927 0.7672
0.9966 0.8182 0.9766 0.6814 0.6694
0.0960 0.8579 0.2197 0.2659 0.3085
0.1443 0.8251 0.5937 1.0475 -0.0864
0.7806 1.0080 0.5504 0.3454 0.5813
See Also rand, randperm, sprand, sprandn
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
matlab隨機(jī)數(shù)
numpy.random.randn()用法
numpy中生成隨機(jī)數(shù)的技巧匯總
numpy數(shù)組、向量、矩陣運(yùn)算
Numpy對(duì)數(shù)組的操作:創(chuàng)建/變形(升降維等)/計(jì)算/取值/復(fù)制/分割/合并
3
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服