plot depth values for each location (latitude, longitude)

5 Ansichten (letzte 30 Tage)
Tiziano Bagnasco
Tiziano Bagnasco am 1 Sep. 2022
Beantwortet: Divyajyoti Nayak am 5 Mär. 2025 um 4:04
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

Antworten (1)

Divyajyoti Nayak
Divyajyoti Nayak vor etwa eine Stunde
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;

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by