makesolvematrix