write matrix, case empty mat
Build Vocabulary