Changes mean to matrix