plot depth values for each location (latitude, longitude)
2 次查看(过去 30 天)
显示 更早的评论
hello everyone!
I have three vectors ( 14084 x 1 double format) that contain respectively latitude, longitude and depth values. I would like to plot the depth values for each pair of lat and long values.
Can anybody help me?
Thank you a lot in advance
回答(1 个)
Divyajyoti Nayak
2025-3-5
I assume you want to get a spherical plot with elevations from your data. To do so, the 'surf' function can be used once the data has been properly formatted in the form of a grid rather than 1-D vectors. The 'sphere' functio can be used to understand how the data needs to be formatted. Here's some sample code to help you out along with some relevant documentation:
lats = -90:1:90;
lons = 0:4:360;
[lats, lons] = meshgrid(lats,lons);
elevation = rand(size(lats))/5;
R = 15; %Radius of sphere.
X = (R+elevation).*cosd(lats).*sind(lons);
Y = (R+elevation).*cosd(lats).*cosd(lons);
Z = (R+elevation).*sind(lats);
surf(X,Y,Z);
axis equal;
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!