MATLAB中的randi函数
2014-01-14 20:00
169 查看
randi Pseudorandom integers from a uniform discrete distribution.来自一个均匀离散分布的伪随机整数
R = randi(IMAX,N) returns an N-by-N matrix containing pseudorandom integer values drawn from the discrete uniform distribution on 1:IMAX.返回一个N×N的包含伪随机整数值的矩阵,这些整数来自均匀分布IMAX
randi(IMAX,M,N) or randi(IMAX,[M,N]) returns an M-by-N matrix.
randi(IMAX,M,N,P,...) or randi(IMAX,[M,N,P,...]) returns an M-by-N-by-P-by-... array. randi(IMAX) returns a scalar.
randi(IMAX,SIZE(A)) returns an array the same size as A.
R = randi([IMIN,IMAX],...) returns an array containing integer values drawn from the discrete uniform distribution on IMIN:IMAX.
Note: The size inputs M, N, P, ... should be nonnegative integers.
Negative integers are treated as 0.
R = randi(..., CLASSNAME) returns an array of integer values of class CLASSNAME.
The arrays returned by randi may contain repeated integer values. This is sometimes referred to as sampling with replacement. To get unique integer values, sometimes referred to as sampling without replacement, use RANDPERM.
The sequence of numbers produced by randi is determined by the settings of the uniform random number generator that underlies RAND, RANDN, and randi.
randi uses one uniform random value to create each integer random value. Control that shared random number generator using RNG.
R = randi(IMAX,N) returns an N-by-N matrix containing pseudorandom integer values drawn from the discrete uniform distribution on 1:IMAX.返回一个N×N的包含伪随机整数值的矩阵,这些整数来自均匀分布IMAX
randi(IMAX,M,N) or randi(IMAX,[M,N]) returns an M-by-N matrix.
randi(IMAX,M,N,P,...) or randi(IMAX,[M,N,P,...]) returns an M-by-N-by-P-by-... array. randi(IMAX) returns a scalar.
randi(IMAX,SIZE(A)) returns an array the same size as A.
R = randi([IMIN,IMAX],...) returns an array containing integer values drawn from the discrete uniform distribution on IMIN:IMAX.
Note: The size inputs M, N, P, ... should be nonnegative integers.
Negative integers are treated as 0.
R = randi(..., CLASSNAME) returns an array of integer values of class CLASSNAME.
The arrays returned by randi may contain repeated integer values. This is sometimes referred to as sampling with replacement. To get unique integer values, sometimes referred to as sampling without replacement, use RANDPERM.
The sequence of numbers produced by randi is determined by the settings of the uniform random number generator that underlies RAND, RANDN, and randi.
randi uses one uniform random value to create each integer random value. Control that shared random number generator using RNG.
相关文章推荐
- Matlab中随机函数:rand函数,randn函数,randi函数
- slider matlab
- 修复Matlab 2013a mex 无法找到macosx10.7 错误 (Xcode 5.0+)
- MATLAB画ROC曲线
- 【matlab】:matlab的输入和输出
- SVM熟练到精通5:MATLAB实例
- Matlab画直线、圆、球
- fortran程序设计2011年5月编程语言排行榜:用MATLAB构建(1
- Matlab贝塞尔函数(Bessel)实现
- 【算法导论】八皇后问题的算法实现(C、MATLAB、Python版)
- Matlab中保存图像时,图形窗口大小的控制
- Matlab与线性代数 -- 矩阵的范数
- MATLAB相机标定
- Matlab------------num2str损失精度问题
- 64位Win8 完美安装Matlab 7.0方法
- 炉温控制(Keil代码+Proteus仿真+Matlab仿真)
- 【matlab】:matlab画饼图和三维饼图
- 图像复原与重建:噪声模型及MATLAB实现
- 数学建模 | 第四讲:MATLAB数据建模方法(下) 机器学习方法
- Matlab------------GUI编程:运算editbox中的数学表达式