I want to receive the output of [I_1,I_2,...,I_n] = ind2sub(siz,IND) for an n-dimensional array with size of dimensions defined in siz. The linear index is a single value in IND. I know the number of elements in each dimension of the array. But the number of dimensions is variable (it is known but variable). I want to know how to receive the output of ind2sub(siz,IND) in variable number of arrays as it needs n number of arrays to receive the output. 
In fact, the number of dimensions is number of attributes of data points in a data set. If data set is called x the number of dimensions is size(x,2).