make-matrix for sequences