Circles of different radius around random points

2 次查看(过去 30 天)
Below is the code and i want to create circle for the new bts location, circle is of radius 0.3kms
% points of interest
P = rand(2, 3);
P1= rand(2, 3);
P2= rand(2, 3);
% Candidate feature set
X = rand(2,20);
X1= rand (2,20);
X2= rand (2,20);
I = nearestneighbour(P, X, 'Radius', 0.3);
I1 = nearestneighbour(P1, X1, 'Radius', 0.3);
I2 = nearestneighbour(P2, X2, 'Radius', 0.3);
figure;
idx = I(I(:, 1) ~= 0, 1);
plot(P(1,:), P(2, :), 'r.', X(1,:), X(2,:), 'b.', 'MarkerSize', 15)
hold on
p1 = repmat(P(1,1), 1, length(idx)); p2 = repmat(P(2,1), 1, length(idx));
quiver(p1, p2, X(1, idx) - p1, X(2, idx) - p2, 0, 'k')
hold on
idx = I1(I1(:, 1) ~= 0, 1);
plot(P1(1,:), P1(2, :), 'r.', X1(1,:), X1(2,:), 'b.', 'MarkerSize', 15)
hold on
p1 = repmat(P1(1,1), 1, length(idx)); p2 = repmat(P1(2,1), 1, length(idx));
quiver(p1, p2, X1(1, idx) - p1, X1(2, idx) - p2, 0, 'k')
hold on
idx = I2(I2(:, 1) ~= 0, 1);
plot(P2(1,:), P2(2, :), 'r.', X2(1,:), X2(2,:), 'b.', 'MarkerSize', 15)
hold on
p1 = repmat(P2(1,1), 1, length(idx)); p2 = repmat(P2(2,1), 1, length(idx));
quiver(p1, p2, X1(1, idx) - p1, X2(2, idx) - p2, 0, 'k')
hold off
xlabel('x distance (km)')
ylabel('y distance (km)')
legend('new BTS coverage= 0.3kms','users')
  5 个评论
YASIR YASH
YASIR YASH 2019-11-24
sir help me to write code for random users around one BTS
Jan
Jan 2019-11-24
@YASIR YASH: Please open a new thread and explain your problem with details.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by