Point not match and connect with the nearest point to line
Afficher commentaires plus anciens
Point not match and connect with the nearest point to line
The data I exported from the ANSYS FLUENT...and when i plot it the line is not follow the black dot but connect in the zig zag direction.. Any one can fix it :(
I wish to know how to rearrange the data so that the i can match the nearest black dot to plot a line in order to erase the unwanted data
5 commentaires
Rik
le 28 Mai 2021
Isn't it possible to adjust this at the source? A first approximation is easy: sort by x-values. To clean up you might need a complex method like calculating the change of direction.
Jan
le 28 Mai 2021
when i plot it the line is not follow the black dot
How do you know, which is the wanted trajectory? How is this defined mathematically? The corner at the bottom looks confusing and I'm not sure, what the wanted path is.
TAN SAK JIE
le 28 Mai 2021
Jan
le 28 Mai 2021
This is not trivial. If the point is preferred, which changes the direction of the former trajectory as small as possible, then the corner at x=0.25 will be a problem:

So you need a smart algorithm, which considers the nearest point, if it is near enough, but decides for another point, if the trajectory is straight enough. For 2D and 3D surfaces Matlab offers the alphaShape , but I do not know the command for a line.
How are the positions of the dots calculated? The creator does not know, that this is a connected graph. Otherwise it should be trivial to output the coordinates in the correct order directly.
Image Analyst
le 28 Mai 2021
Are you willing to simply hand draw a dividing line through the right and left portions?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Vector Fields dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

