InPolygon data selection from a data file

1 回表示 (過去 30 日間)
amberly hadden
amberly hadden 2015 年 5 月 15 日
編集済み: Walter Roberson 2015 年 5 月 15 日
Hi
I have following data
Lat Lon Reading
23 56 1
24 58 2
26 59 3
22 57 4
25 54 5
29 51 6
22 52 7
21 50 8
now I want to select data which lies in specific lat lon range, lets say lat = 21-25 and lon = 50-54
in polygon function is only allowing me set two points

採用された回答

amberly hadden
amberly hadden 2015 年 5 月 15 日
編集済み: Walter Roberson 2015 年 5 月 15 日
numbers = xlsread('test.xls');
lats = numbers(:, 1);
lons = numbers(:, 2);
z = numbers(:, 3);
lat1 = 58.4
lon1 = 26.1
z1 = 1.65
lat2 = 58.5
lon2 = 27
z2 = 1.11
desiredLats = lats >= lat1 & lats <= lat2
desiredLons = lons > lon1 & lons <= lon2
desiredZs = z <= z1 & z >= z2
rowsToExtract = desiredLats & desiredLons & desiredZs
extractedRows = numbers(rowsToExtract, :)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCartesian Coordinate System Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by