suppose A=[D G H K ... O];
i want to do C=[H D O .... G.. K]
i also want to keep the information about the order of randomization to use it other matrix further manipulation.
ind=randperm(size(A,2)); C=zeros(size(A)); C=A(:,ind);
ind preserves the order of randomization.
The pre-allocation by zeros is useless here. A pre-allocation is useful only, if the array would grow iteratively.
0 Comments