change matrix generate