unifrnd可以创建随机的连续均匀分布的数组。
1.R = unifrnd(A,B)
returns an array of random numbers chosen from the continuous uniform distribution on the interval from A to B. The size of R is the common size of A and B if both are arrays. If either parameter is a scalar, the size of R is the size of the otherparameter.
这是matlab自带的帮助文件的解释,比较简略,以下补充本人的理解:
A和B可以是向量也可以是标量,若两个都是向量,则两者都是列向量或都是行向量,而且维数相等。从A到B产生一系列区间,若A和B均为向量,则区间个数等于他们的维数;若其中恰有一个是向量,假设A为向量,则区间个数等于A的维数;若两个均为标量,则A <= B,区间个数为1,且区间为[A,B]。然后在这一系列区间中随机产生连续均匀分布的数组R并返回之。具体例子下述。