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

조회 수: 5 (최근 30일)
Michelle De Luna
Michelle De Luna 2021년 4월 1일
댓글: Michelle De Luna 2021년 4월 2일
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.

채택된 답변

darova
darova 2021년 4월 1일
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)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by