Filter löschen
Filter löschen

Display plotted "if loop" data in a worldmap?

1 Ansicht (letzte 30 Tage)
Philipp Henschel
Philipp Henschel am 21 Dez. 2017
Beantwortet: Philipp Henschel am 24 Jan. 2018
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

Akzeptierte Antwort

Philipp Henschel
Philipp Henschel am 24 Jan. 2018
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);

Weitere Antworten (0)

Kategorien

Mehr zu Geographic Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by