1、rand-均匀分布
rand 产生由在(0, 1)之间均匀分布的随机数。
rand returns a single uniformly distributed random number in the interval (0,1).
2、randn-正态分布
randn 产生均值为0,方差为1的标准正态分布的随机数。
randn returns a random scalar drawn from the standard normal distribution.
3、randi-指定范围均匀分布
产生在[1, imax] 均匀分布的伪随机整数。
randi(imax) returns a pseudorandom scalar integer between 1 and imax.
4、randsrc-指定概率随机分布
randsrc(m, n, [alphabet; prob]) 产生一个m-by-n的矩阵,矩阵的元素从alphabet里抽取,alphabet每个元素被抽中的概率由prob指定。
randsrc(m, n, [alphabet; prob]) generates an m-by-n matrix, with each entry independently chosen from the entries in the row vector alphabet. Duplicate values in alphabet are ignored. The row vector prob lists corresponding probabilities in prob.
5、randperm-随机排序
randperm(n) 产生一个1到n的随机顺序。
randperm(n) returns a row vector containing a random permutation of the integers from 1 to n inclusive.
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:dandanxi6@qq.com