Matrix1  to array, input check