Hi I want to permute each row and column of the matrix using specified permutation
e.g
%%%%%Permute each row by a certain permutation e.g (3 2 4 1)
M=[80 81 82 83;84 85 86 87;88 89 90 91;92 93 94 95];perm2=[3 2 4 1];M_1=[];b=M;for i=1:3 b(i,perm2) = M(i,:); M_1=[b];endOutput should be 82 81 83 8086 85 87 8490 89 91 8894 93 95 92what I am getting is 83 81 80 8287 85 84 8691 89 88 9092 93 94 95
If some one figure out the mistake plus how to permute each column wise
Best Answer