coonecting line closer to next xy coordinates based on distance
1 次查看(过去 30 天)
显示 更早的评论
I have attached my XY coordinates and you can see RED and BLUE marked in the picture attached.
I would like to coonect this lines in the similar way, how it appears in picture attached.
Is there any way to do this , if so , can you please do help me out with example code.
回答(3 个)
Alexandra McClernon Ownbey
2020-4-9
x = pointdbscan.x;
y = pointdbscan.y;
d = sqrt(x.^2+y.^2);
dz = diff(d);
xplot{1}(1) = x(1);
yplot{1}(1) = y(1);
j = 1;
k = 0;
for i = 1:length(dz)
if dz(i) > 20
j = j+1;
k = 0;
end
k = k+1;
xplot{j}(k) = x(i+1);
yplot{j}(k) = y(i+1);
end
figure
ax = axes;
hold(ax,'on')
p = cellfun(@plot, xplot,yplot);
set(p,'color','b')
3 个评论
Alexandra McClernon Ownbey
2020-4-9
Satya,
you will need to more specific in your question. Is the data you have in centimeters and you want 20 meters? Is the condition 20 meters in one direction?
SatyaPrakash Gupta
2020-4-17
1 个评论
Rik
2020-4-18
can you help me here please
@SatyaPrakash, please don't use flags for comments.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!