$LastChangedDate: 27-Juil-2011 $

# CL_covDraw

Random values from covariance

## Calling Sequence

       [values] = CL_covDraw(means,cov,num)

## Description

- Returns randomly drawn samples of the random variable X, knowing the expectation of X and its covariance matrix.

## Parameters

means :

  Vector of expectations (Nx1)

cov:

  Covariance matrix (NxN)

num :

  (integer) Number of random samples to draw

values :

  Matrix containing the random samples. Each sample is a column vector. The number of columns is num. (NxP)

## Authors

- CNES - DCT/SB

## See also

- CL_cov2cor

## Examples

    // draw 10000 position samples knowing the covariance matrix.
    pos =  [-1877901; -3909428; -5026025]; //position
    cov = [1.0, -0.46, -0.44;-0.46, 1.0, -0.43;-0.44, -0.43, 1.0];
    [drawn_pos] = CL_covDraw(pos,cov,10000);  // drawn values

    // estimate mean values and covariance from samples
    [pos2, cov2] = CL_stat(drawn_pos);