MATLAB: How iterate inside a excel file and every 21 rows store values in a matrix

for loopimporting excel dataiterationxlsread

I have a attached excel file, and I need to store values in col B and C for each 21 rows in different matrix. I am wondering how can I iterate through excel file and also have a loop to do this.
What I already have, it is pushing the first 21 rows for col B and C inside the ED_X and ED_Y, and the next 21 rows inside the ES_X and ES_Y. How can I do this through all the excel file?
The excel file is very large file. It does have 425272 rows. I just attached a sample of small file.
sheet1 = 'VolumeTracings';
xlRange1 = 'A2:H425272';
[XY,fileName] = xlsread('VolumeTracings.csv',sheet1,xlRange1);
Label_XY(:,1) = XY(:,1); %x1
Label_XY(:,2) = XY(:,2); %y1
ED_X = Label_XY(1:21,1)
ED_Y = Label_XY(1:21,2)
ES_X = Label_XY(22:42,1)
ES_Y = Label_XY(22:42,2)

Best Answer

How about saving to a cell array?
sheet1 = 'VolumeTracings - Copy';
[XY,fileName] = xlsread('VolumeTracings - Copy.csv',sheet1);
% Label_XY(:,1) = XY(:,1); %x1
% Label_XY(:,2) = XY(:,2); %y1
Label_X = reshape(XY(:,1),21,[]);
Label_Y = reshape(XY(:,2),21,[]);
nmax = size(Label_X,2);
EX = cell(1,nmax); EY = EX;
for n=1:nmax
EX{n} = Label_X(:,n);
EY{n} = Label_Y(:,n);
end