Home »
Public Forums »
archive »
locating the closest values?
locating the closest values? [message #80682] |
Tue, 26 June 2012 13:55 |
anil
Messages: 34 Registered: August 2009
|
Member |
|
|
Hi,
I have two datasets/files. 1st one contains the values i want to find
(latitudes and longitudes) and the second file contains 3 columns as
longitude latitude and depth.
What i want to do is to read my desired values from file 1 and find
the closest values in file 2 and the corresponding 3rd column(depth)
from file 2. here is what i did:
1st file:
42.25 30.57
41.17 32.58
......
2nd file
42.55 34.42 1000
41.54 33.21 1500
.......
what i did is :
difference1=abs(lon-desiredlon)
a1=min(difference1,index1)
difference2=abs(lat-desiredlat)
a2=min(difference2,index2)
in this case, lon(index1) and lat(index2) become my desired values. no
problem with that. but how do i get the 3rd column. i could not match
index1 and index2 with where function.
what am i missing here?
|
|
|
Current Time: Wed Oct 08 19:05:58 PDT 2025
Total time taken to generate the page: 0.00592 seconds