MATLAB: How can i change position in the matrix

matrix manipulation

i have some problem, how can i change position of matrix. example i have matrix [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16] how can i change that matrix into matrix like this ? [1 2 3 4; 8 7 6 5; 9 10 11 12; 16 15 14 13]
thankyou very much

Best Answer

a=[1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]
expected_result=[1 2 3 4; 8 7 6 5; 9 10 11 12; 16 15 14 13]
a(2:2:end,:)= fliplr(a(2:2:end,:))
logical(a==expected_result) % to verify your result and the expected result are same