You could do:
figure
hold on
for i=3:6:225
x=xlsread('test.xlsx','Sheet1',['B' int2str(i) ':JB' int2str(i)]);
y=xlsread('test.xlsx','Sheet1',['B' int2str(i+1) ':JB' int2str(i+1)]');
if mod(i,18)==3 % 3, 21, ...
plot(x,y,'g')
elseif mod(i,18)==9 % 9, 27, ...
plot(x,y,'b')
else % that is, if mod(i,18)==15 % 15, 33, ...
plot(x,y,'r')
end
end
hold off
Best.
figure
hold on
for i=3:6:225
x=xlsread('test.xlsx','Sheet1',['B' int2str(i) ':JB' int2str(i)]);
y=xlsread('test.xlsx','Sheet1',['B' int2str(i+1) ':JB' int2str(i+1)]');
if mod(i,18)==3 % 3, 21, ...
plot(x,y,'g')
elseif mod(i,18)==9 % 9, 27, ...
plot(x,y,'b')
else % that is, if mod(i,18)==15 % 15, 33, ...
plot(x,y,'r')
end
end
hold off
Best.