Circles of different radius around random points

2 visualizaciones (últimos 30 días)
Simran Sandhu
Simran Sandhu el 25 de Abr. de 2019
Comentada: Jan el 24 de Nov. de 2019
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 comentarios
YASIR YASH
YASIR YASH el 24 de Nov. de 2019
sir help me to write code for random users around one BTS
Jan
Jan el 24 de Nov. de 2019
@YASIR YASH: Please open a new thread and explain your problem with details.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Biotech and Pharmaceutical en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by