randMat

버전 1.2.0.0 (1.83 KB) 작성자: Richard Crozier
Generate random numbers uniformally in a given range or matching a given normal distribution
다운로드 수: 2K
업데이트 날짜: 2009/10/6

라이선스 보기

randMat: Generates a matrix of random numbers with uniform or normal distribution on a specified interval [a,b] or with a specific mean (a) and variance (b) for any number of a,b pairs. For uniform distributions,the values returned by the MATLAB function rand() are multiplied by (b-a), then added to a. For normal distributions the output of randn() is multiplied by the standard deviation (b), and then added to the desired to the mean (a).

Arguments: (input)

a - (i x 1) row vector of values specifying the lower limit in each
interval or mean value of the normal distribution.

b - (i x 1) row vector of values specifying the higher limit in each
interval or variance of the normal distribution.

method - (i x 1) row vector of integers to indicate normal or uniform
distribution for each corresponding a,b pair, 0 indicates a
uniform distribution, 1 indicates a normal distribution.

n - scalar, number of random numbers to be output for all desired
distributions.

newseed - optional scalar, if 1, a new seed is generated from the
system clock, if 0 the existing sequence is used. If
omitted, the default value is zero.

Arguments: (output)

numbers - (i x n) matrix of random numbers generated for each a,b pair
in the input arguments. Each a,b pair's corresponding output is
represented by a column of n random numbers.

인용 양식

Richard Crozier (2024). randMat (https://www.mathworks.com/matlabcentral/fileexchange/24712-randmat), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

added option whether to use a new seed value or not

1.1.0.0

now initialise the state of the pseudorandom number generator on entering function to prevent multiple instances of Matlab generating the exact same stream of numbers.

1.0.0.0