coonecting line closer to next xy coordinates based on distance
Mostra commenti meno recenti
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.
1 Commento
Image Analyst
il 9 Apr 2020

Risposte (3)
Alexandra McClernon Ownbey
il 9 Apr 2020
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 Commenti
SatyaPrakash Gupta
il 9 Apr 2020
Alexandra McClernon Ownbey
il 9 Apr 2020
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
il 9 Apr 2020
Image Analyst
il 9 Apr 2020
0 voti
See my attached edge linking demos. Adapt as needed.
10 Commenti
SatyaPrakash Gupta
il 13 Apr 2020
SatyaPrakash Gupta
il 14 Apr 2020
Image Analyst
il 14 Apr 2020
Your data does not look like what you posted:
s = load('pointdbscan.mat')
x = s.pointdbscan.x;
y = s.pointdbscan.y;
plot(x, y, 'b.', 'MarkerSize', 7);
grid on;

Or, if I plot x and y separately vs. index:

SatyaPrakash Gupta
il 15 Apr 2020
Modificato: SatyaPrakash Gupta
il 15 Apr 2020
Image Analyst
il 15 Apr 2020
So you're looking at x and y individually vs. index? Do you want the centerline? Did you try movmean(), movmedian(), or sgolayfilt()?
SatyaPrakash Gupta
il 15 Apr 2020
Rik
il 15 Apr 2020
waiting for your input
SatyaPrakash Gupta
il 16 Apr 2020
Image Analyst
il 16 Apr 2020
So are we done now?
SatyaPrakash Gupta
il 16 Apr 2020
Modificato: SatyaPrakash Gupta
il 16 Apr 2020
SatyaPrakash Gupta
il 17 Apr 2020
0 voti
1 Commento
Rik
il 18 Apr 2020
can you help me here please
@SatyaPrakash, please don't use flags for comments.
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



