MATLAB: I have 100 data scattered across 100 X 100 size plot. I need to partition the plot into four sub-sections across the center. Can anyone help me.

MATLABpartitionsplot

close all
clear
clc
n=100
for h=1:1
for i=1:1:n
if(i<=25)
S(i).xd=randi([0,40]);
S(i).yd=randi([0,40]);
end
if((i>25)&&(i<=50))
S(i).xd=randi([60,100]);
S(i).yd=randi([0,40]);
end
if((i>50)&&(i<=75))
S(i).xd=randi([0,40]);
S(i).yd=randi([60,100]);
end
if(i>75)
S(i).xd=randi([60,100]);
S(i).yd=randi([60,100]);
end
XR(i)=S(i).xd;
YR(i)=S(i).yd;
figure(1)
plot(XR(i),YR(i),'kp','MarkerSize', 8);
drawnow;
hold on;
end
end

Best Answer

starting from R2018b you can use xline and yline:
close all
clear
clc
n=100
hold on
for h=1:1
for i=1:1:n
if(i<=25)
S(i).xd=randi([0,40]);
S(i).yd=randi([0,40]);
end
if((i>25)&&(i<=50))
S(i).xd=randi([60,100]);
S(i).yd=randi([0,40]);
end
if((i>50)&&(i<=75))
S(i).xd=randi([0,40]);
S(i).yd=randi([60,100]);
end
if(i>75)
S(i).xd=randi([60,100]);
S(i).yd=randi([60,100]);
end
XR(i)=S(i).xd;
YR(i)=S(i).yd;
figure(1)
plot(XR(i),YR(i),'kp','MarkerSize', 8);
drawnow;
end
end
xline(50);
yline(50);
hold off