フィルターのクリア

Display plotted "if loop" data in a worldmap?

1 回表示 (過去 30 日間)
Philipp Henschel
Philipp Henschel 2017 年 12 月 21 日
回答済み: Philipp Henschel 2018 年 1 月 24 日
I'm working a dataset containing Lat&Lons of multiple flightroutes. I'm plotting these into a figure, since the number of routes varies, using an if-loop plot :
figure()
for ii = 1:length(a.asdiflightplanid)
k=find(b.asdiflightplanid == a.asdiflightplanid(ii));
plot(b.longitude(k), b.latitude(k))
hold on;
end
now I want to plot these into a worldmap (USA) using the Mapping Toolbox:
worldmap([Minimal_LATPC-10 Maximal_LATPC+10], [Minimal_LONPC-5 Maximal_LONPC+5])
getm(gca,'MapProjection');
geoshow('landareas.shp','FaceColor',[224/256 224/256 224/256]);
geoshow('worldlakes.shp','FaceColor',[117/256 217/256 242/256]);
geoshow('worldcities.shp','Marker','.','MarkerEdgeColor',[118/256 122/256 121/256]);
the Minimum and Maximimu of Lat&Lon are defined before by the Lat&Lons used in the if-loop plot. But all my tries failed and mostly as a result either just receive an map of the US (geoshowing land, cities etc.), or my flightroutes in a Cartesian coordinate system, or an Error Message that I cannot combine these two plot (especially while using "plotm"). Any suggestion how I can combine these two?
Any help would be appreciated! Thanks

採用された回答

Philipp Henschel
Philipp Henschel 2018 年 1 月 24 日
Found a solution by myself using the ismember function & creating a table with just the rows i need
A = b(ismember(b.asdiflightplanid, a.asdiflightplanid),:);
and then using geoshow
geoshow(b.latitude, b.longitude);

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by