TITLE: Correlation matrix from Covariance matrix
QUESTION [18 upvotes]: This is for a project which I've been trying to find some information for Covariance matrix and correlation matrix.
I understand that for a $n \times n$ matrix $A, AA^T$ will give me the covariance matrix.
Is there any relationship between the covariance and correlation matrix?
Sorry maybe I wasn't clear.
I wanted to use Cholesky decomposition to generate correlated variables from random variables. I do know how to do it using matlab. And I understand how it works for 2 variables. But when I scale up the matrix to $n \times n$ instead of $2 \times 2$, I am not sure how it will work out.
would appreciate if someone could provide more hint on the mathematics.

REPLY [2 votes]: Cribbing from the answer by Brian B., assume your covariance matrix is Σ  and let
D = sqrt(diag(Σ)), a vector of square roots of the diagonal of Σ.
then the correlation matrix is given by 
ϱ = D-inverse Σ D-inverse-prime  
D, here, is a p x 1 vector (from the diagonal of Σ) and its inverse is the item by item inverse of D -- i.e., vector of {one over element} for each element.