MATLAB: How to get odd rows and columns,even rows and columns

.

A1 is the lena image
A is to the first row
similarly how to get the even rows ,even columns,odd rows,odd columns
A1 = imread('lena1.jpg');
A=A1(:,1);

Best Answer

Consider you have number of rows and columns which is an even number,
Odd rows:
A1(1:2:end-1,:)
Even rows:
A1(2:2:end,:)
Odd columns:
A1(:,1:2:end-1)
Even columns:
A1(:,2:2:end)