2016-07-06 204 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