plot depth values for each location (latitude, longitude)
2 views (last 30 days)
Show older comments
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
Answers (1)
Divyajyoti Nayak
on 5 Mar 2025
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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!