MATLAB: How to flip only some rows inside a matrix

flipindexing a matrix to flip

Hi, I have a matrix xx which is a 6×20 matrix, and I want to flip only the even rows. Im trying this but is doesn't work:
f=size(xx);
f=f(1);
f=0:1:f;
f=f';
for s=f+2
xx(f,:)=fliplr(xx(f,:));
end
I will appreciate any advice. Martha

Best Answer

A(2:2:end,:)=fliplr(A(2:2:end,:))