Effacer les filtres
Effacer les filtres

Display plotted "if loop" data in a worldmap?

1 vue (au cours des 30 derniers jours)
Philipp Henschel
Philipp Henschel le 21 Déc 2017
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

Réponse acceptée

Philipp Henschel
Philipp Henschel le 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);

Plus de réponses (0)

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by