Add devide function to split array, matrix or list