update repeat function

to create a new matrix through current matrix by repeat the content by
row or by column