Matix Calculation