How to select data with identical lat lon from two large matrixes ?

1 回表示 (過去 30 日間)
amberly hadden
amberly hadden 2015 年 5 月 11 日
コメント済み: amberly hadden 2015 年 5 月 11 日
I have been working with the satellite data. So I have exported two matrices in matlab which contains nearly 230000 and 370000 rows and 3 columns respectively. The first 2 columns are latitude and longitude and next columns contain readings. what should I do to select the data so that out put is a matrix with latitude and longitude and next two columns gives reading for matrix 1 and 2.
M-1 Lat Lon Reading M2 Lat Lon Reading
23 56 1 24 58 3
24 58 2 25 54 5
26 59 3 27 58 6
22 57 4 23 56 9
25 54 5 26 59 8
29 51 6 30 60 4
22 52 7 23 54 2
21 50 8 22 56 3
Result Lat Lon M1 M2
23 56 1 9
24 58 2 3
26 59 3 8
Thanks, in advance

採用された回答

Walter Roberson
Walter Roberson 2015 年 5 月 11 日
M1LL = M1(:,1:2);
M2LL = M2(:,1:2);
[M1inM2, M2idx] = ismember(M1LL, M2LL, 'rows');
joinedM1M2 = [M1(M1inM2,:), M2(M2idx(M1inM2), 3)];
  2 件のコメント
amberly hadden
amberly hadden 2015 年 5 月 11 日
Thanks, Walter but output is an empty matrices
amberly hadden
amberly hadden 2015 年 5 月 11 日
My be its a rounding error ? as when I applied it to roigonal data set the output is an empty matrix.. I'm trying to round the digits to two decimals and then apply it. Thanks

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by