Reputation: 147
I'm trying to plot the ground-track of a satellite in a given orbit in Matlab. I already have the data sets that contain the x, y, z position of the satellite as well as the longitude and latitude data. I only have a problem with plotting it.
I already made a scatter3(x, y, z) graph which looks okay but I want to make a 2D projection onto a map in the well-known ground-track style. If I simply do plot(longitude, latitude) the graph will by wierd as you would expect without any projection.
My data:
[x; y; z; long; lat]
All five are arrays containing a few revolutions worth of position data. How do I make an earth-map like 2D - plot where the lines look like sinusoids? I couldn't find anything in Matlab's help section about projections.
Upvotes: 2
Views: 4047
Reputation: 147
The best thing I found was using the "worldmap world" function which looks like the following:
worldmap world
load coastlines
[latcells, loncells] = polysplit(coastlat, coastlon);
plotm(coastlat, coastlon, 'green')
hold on
plotm(lat, long, 'blue')
where lat and long are the vectors containing the position data.
Upvotes: 1