In reply to Amany Hassan.

The easiest way is to use the COLVEC function to create a column vector and then use VAR to compute the variance:
v = var( colvec(M) );