Creating a 3-D Plot/Contour Map from Matrix...

10 vues (au cours des 30 derniers jours)
Michelle De Luna
Michelle De Luna le 1 Avr 2021
Good evening!
I have multiple 21 x 21 matrices that represent temperature at 21 different atmospheric pressure levels and 21 different parallels of latitude. I am able to visualize fluctuations in temperature through the atmosphere and at different latitudes just fine using a simple 2-D contour method. In other words, I use the contour function on the 21 x 21 matrix to check temperature on a plot where the x-axis represents latitude and the y-axis represents atmospheric pressure level; temperature is indicated using isoline, or lines that connect constant values of temperature.
Each 21 x 21 matrix represents temperature values along a SINGLE meridian of longitude. So, each matrix is like a "slice" running along one single longitude but 21 different pressure levels and 21 latitudes. Is there any way to piece together a bunch of these 21 x 21 matrices or "slices" to make a 3-D plot or contour map? So that I not only show temperature across pressure levels and latitudes but also along various longitudes? Any help would be greatly appreciated.
Best,
M.

Réponse acceptée

darova
darova le 1 Avr 2021
Try griddata
x = rand(20,1);
y = rand(20,1);
z = rand(20,1);
[x1,y1] = meshgrid(0:0.1:1);
z1 = griddata(x,y,z,x1,y1);
plot3(x,y,z,'or')
surface(x1,y1,z1)
  1 commentaire
Michelle De Luna
Michelle De Luna le 2 Avr 2021
Thank you, Darova! This helped!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Contour Plots 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!

Translated by