Statistics Toolbox | ![]() ![]() |
Random matrices from the multivariate normal distribution
Syntax
Description
R = mvnrnd(MU,SIGMA)
returns an n
-by-d
matrix R
of random vectors chosen from the multivariate normal distribution with mean MU
, and covariance SIGMA
. MU
is an n
-by-d
matrix, and mvnrnd
generates each row of R
using the corresponding row of MU
. SIGMA
is a d
-by-d
symmetric positive semi-definite matrix, or a d
-by-d
-by-n
array. If SIGMA
is an array, mvnrnd
generates each row of R
using the corresponding page of SIGMA
, i.e., mvnrnd
computes R(i,:)
using MU(i,:)
and SIGMA(:,:,i)
. If MU
is a 1
-by-d
vector, mvnrnd
replicates it to match the trailing dimension of SIGMA
.
r = mvnrnd(MU,SIGMA,cases)
returns a cases
-by-d
matrix R
of random vectors chosen from the multivariate normal distribution with a common 1
-by-d
mean vector MU
, and a common d
-by-d
covariance matrix SIGMA
.
Example
See Also
![]() | mvnpdf | mvtrnd | ![]() |