![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/173863/image.png)
plotting lat, lon, altitude, variable
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have 3 vectors of latitude, longitude, and elevation respectively. I also have a corresponding 3d matrix of size latitude*longitude*elevation which contains some data (Temperature). I want to display the Temperature data in 3d space. What is the best way to do this? Note: I don't want to use trisurf because it requires reshaping the matrix into 3 separate vectors, with which I found difficulty in tracking the data points.
Many thanks.
-Sagar
0 commentaires
Réponse acceptée
Chad Greene
le 11 Mar 2015
% Some data:
[lon,lat,z] = meshgrid(-180:3:180,-90:2:90,0:50:1000);
T = 20 - .1*abs(lat) - .01*z + sind(lon);
% Plot dataset:
pcolor3(lon,lat,z,T);
% Add labels:
xlabel('longitude')
ylabel('latitude')
zlabel('elevation (m)')
title('temperature or something')
axis tight
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/173863/image.png)
0 commentaires
Plus de réponses (3)
Sagar
le 15 Mar 2015
1 commentaire
Chad Greene
le 16 Mar 2015
Or similarly,
in = ingeoquad(lat,long,[0 40],[-20 70]);
long(~in) = NaN;
lat(~in) = NaN;
Voir également
Catégories
En savoir plus sur Climate Science and Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!