2016-07-06 69 views
0

Mathematica的ListDensityPlot []可以獲取三維座標列表,其中第三個座標爲標量,稱之爲溫度或濃度等,並返回密度圖。該列表看起來像Mathematica的ListDensityPlot []函數等效於Matlab

temperature={{0,0,20},{0,1,25},...,{9,9,35}} 

以Mathematica表示法。

Mathematica自動對這些值進行插值(我猜),所以它會返回一個連續的,平滑的圖片和一個色階以描述2D平面上的標量值。

在Matlab中有什麼等價的嗎?

感謝

+0

['contour'(http://www.mathworks.com/help/matlab/ref/contour.html)? – excaza

+0

@excaza等值線似乎等同於Mathematica中的ContourPlot [],它不能給網格上的每個點都提供顏色函數,它會顯示解決方程或不等式的所有點。 到目前爲止,似乎pcolor是唯一接近DensityPlot的東西。但mathematica的ListDensityPlot也爲列表返回一個連續的結果,而據我所知,pcolor只返回像素化的彩色斑點,我需要運行自己的插值來獲得平滑的結果。這比Mathematica的插值運行速度更快並且更好 – Craig

回答

0

您可以使用平面點的Delaunay三角功能,然後生成在三角的表面。

這將是這個樣子:

Points=[xpoints, ypoints, zpoints]; 
tri=delaunay(Points(:,1), Points(:,2)); 
figure 
trisurf(tri, Points(:,1), Points(:,2), Points(:,3)) 
shading interp 
colormap jet 
colorbar EastOutside