add function: convertMatrixType