$LastChangedDate: 27-Juil-2011 $

# CL_cor2cov

Correlation to covariance matrix

## Calling Sequence

       cov = CL_cor2cov(cor,sd)

## Description

- Computes the covariance matrix from the correlation matrix and the standard deviations.

  The covariance matrix is built as follows:

  - cov(i,i) = sd(i)^2

  - cov(i,j) = cor(i,j) * sd(i) * sd(j)

## Parameters

cor:

  Correlation matrix (NxNxK)

sd:

  Standard deviations vector (NxK)

cov:

  Covariance matrix (NxNxK)

## Authors

- CNES - DCT/SB

## See also

- CL_cov2cor

## Examples

    // Random covariance matrix :
    N=6; K=2;
    mat = rand(N,N,K,key="normal");
    cov = mat'*mat;  // symetrical
    [cor,sd] = CL_cov2cor(cov);

    // Retrieving the covariance :
    cov2 = CL_cor2cov(cor,sd) ;