how to plot node in particular range but x and y lim is 1000x1000

2 次查看(过去 30 天)
bs=4;
area=1000;
X_coord=rand(1,bs)*area
Y_coord=rand(1,bs)*area
if ((X_coord<=100)&(X_coord>=880))
X_coord=rand(1)*area
end
if ((Y_coord<=100)&(Y_coord>=880))
Y_coord=rand(1)*area
end
for i2=1:bs
plot(X_coord(i2),Y_coord(i2),':o','LineWidth',3,'MarkerEdgeColor','k','MarkerFaceColor',...[0.5,0.5,0.5],'MarkerSize',3)
text(X_coord(i2),Y_coord(i2),'BS')
hold on
end
In above coding i need some solution if X_coord and Y_coord value is less than 100 and gteater than 880 shown in 3 and 4 line of above code, then it will again calculate particular X_coord and Y_coord value for ploting

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by