MATLAB: New arrangement of column and row

row column matrix arrangment

How to rearrange column and row matrix?For example, I have 10×10 matrix size. what I really want to do is
A[1:10,1:10] %original position of column & row matrix size
A2[2 4 6 8 10 1 3 5 7 9,2 4 6 8 10 1 3 5 7 9] %New arrangement of column and row position in matrix
Hope anyone can guide me.Thank you.

Best Answer

I’m not certain what you want as your result, but this looks correct to me:
K = randi(99,10)
K2 = K([2 4 6 8 10 1 3 5 7 9]',[2 4 6 8 10 1 3 5 7 9]')
You have to transpose the row and column reference vectors.