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
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;

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by