matlab绘制三个变量的三维图(三维网状图和三维曲面图)
matlab绘制三个变量的三维图(三维网状图和三维曲面图)surf三维曲面图surf(X Y Z) creates a three-dimensional surface plot. The function plots the values in matrix Z as heights above a grid in the x-y plane defined by X and Y. The function also uses Z for the color data so color is proportional to height.程序运行结果如下:mesh(X Y Z) draws a wireframe mesh with color determined by Z so color is proportional to surface height.mesh三维网状图
接上篇:Matlab精彩画图示例:绘制图上图
这篇介绍两个绘制三维图的命令:
- mesh - 绘制三维网状图
- surf - 绘制三维曲面图
matlab代码如下:
绘制三维图的matlab代码示例
程序运行结果如下:
mesh(X Y Z) draws a wireframe mesh with color determined by Z so color is proportional to surface height.
mesh三维网状图
surf(X Y Z) creates a three-dimensional surface plot. The function plots the values in matrix Z as heights above a grid in the x-y plane defined by X and Y. The function also uses Z for the color data so color is proportional to height.
surf三维曲面图
colorbar是色彩条状图的命令,默认显示在图形的右侧。
colorbar displays a vertical colorbar to the right of the current axes or chart. Colorbars display the current colormap and indicate the mapping of data values into the colormap.
扩展阅读
Matlab学结:从入门到离不开