Solve inverse matrix