简体   繁体   中英

How to plot the trajectory of points given as list of (latitude, longitude) pairs on a 3D globe?

I have a 2x1000 matrix with latitude values in 1st row and longitude values in 2nd row.

I want to plot a trajectory using these values on a 3D globe.

You can get some inspiration here , and then use the plot3m function.

Here is an exemple:

% Create the globe with graticule
axesm('globe');
gridm('GLineStyle','-','Gcolor',[.8 .7 .6],'Galtitude', .02);    
load coast
plot3m(lat,long,.01,'k');

% Define lat and long
lat = sort(360*rand(50,1));
lon = 180*rand(50,1);

% Plot trajectory
h = plot3m(lat,lon,'r.-', 'MarkerSize', 20);
view(3);

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM