MATLAB: MATLAB function for reordering the matrix rows and columns as desired

matlab functionreordering matrix

Hi all,
Suppose I have a nxn matrix ordered row-wise as well as column-wise as 1,2,3…10 (say n=10). Now if I wish to reorder the columns of this matrix as per the order [2 6 1 7 9 3 4 5 10 8], is there a MATLAB function readily available for the task?
Regards,
N. Madani SYED

Best Answer

A(:,[2 6 1 7 9 3 4 5 10 8])
Easy ;-)