MATLAB: How to randomize the column position of a matrix MATLABmatrix manipulation 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. Best Answer ind=randperm(size(A,2));C=zeros(size(A));C=A(:,ind);ind preserves the order of randomization. Related SolutionsMATLAB: How to randomizes the order of the rows of a matrix M = [1:100]'; %Your matrixM = M(randperm(size(M,1)),:); %Your randomly permuted matrix by row MATLAB: Fast matrix multiplication in loop a=rand(3,3);b=rand(100,3);n=size(a,2);m=size(b,1);c=zeros(m,n);for i=1:size(b,1) c(i,:)=a*b(i,:)';end%or simplyc=(a*b')' Related QuestionIs there any ways that I can preallocate the unknown sized array or matirxHow i will choose a random element of a matrixRestructure matrix to get back original matrixReshape a matrix into vector using rowsFor loop taking too long to operate
Best Answer