フィルターのクリア

Find closest coordinates to a list of points

3 ビュー (過去 30 日間)
Danilo M
Danilo M 2018 年 7 月 18 日
編集済み: Aquatris 2018 年 7 月 18 日
I have a list of gauge stations like this
Code X Y
12345678 -35.74 -18.24
01234567 -38.71 -18.42
...
And a list of disasters events like this
Date X Y
2016/1/1 -35.73 -18.24
...
I need to find the nearest gauge station for each event, than add the code of corresponding station as a row on disaster matrix:
Date X Y near_station
2016/1/1 -35.73 -18.24 12345678
...
Any suggestions how can I do this on MatLab?
  2 件のコメント
Aquatris
Aquatris 2018 年 7 月 18 日
編集済み: Aquatris 2018 年 7 月 18 日
There is a built-in Matlab function dsearchn. Alternatively, you can write your own code using an approach similar to the one given for another question here.
Rik
Rik 2018 年 7 月 18 日
@Aquatris, you can move this comment to the answer section, because it actually answers the question. Feel free to put answers in the answer section without example code as well.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by