How do i do average calculations for matrix tables per row?