Changing point coordinates in a file to closest ones in another file
Show older comments
I have a file M1 containing a matrix from this form, for example
1 10 45
2 32 56
3 12 50
4 28 67
The second and third column are x and y coordinates of nodes and the first column is the id of the node. And another one M2 containing another matrix, for example
10 50
30 60
These columns are coordinates of, let's say, reference nodes
What I want to do is to change the coordinates in the first file to the closest one to them in the second file. So my result, will be something like this:
1 10 50
2 30 60
3 10 50
4 30 60
Any hints or ideas how to do it?
Accepted Answer
More Answers (1)
etudiant_is
on 27 Feb 2016
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!