Matrix generation method implemented