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.
1 view (last 30 days)
Show older comments
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
Accepted Answer
Stephan
on 14 Jul 2019
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
More Answers (0)
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!