필터 지우기
필터 지우기

Circles of different radius around random points

조회 수: 2 (최근 30일)
Simran Sandhu
Simran Sandhu 2019년 4월 25일
댓글: Jan 2019년 11월 24일
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