Filter löschen
Filter löschen

Circles of different radius around random points

2 Ansichten (letzte 30 Tage)
Simran Sandhu
Simran Sandhu am 25 Apr. 2019
Kommentiert: Jan am 24 Nov. 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 Kommentare
YASIR YASH
YASIR YASH am 24 Nov. 2019
sir help me to write code for random users around one BTS
Jan
Jan am 24 Nov. 2019
@YASIR YASH: Please open a new thread and explain your problem with details.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by