MATLAB常用三维绘图

来源:matlab  › 资源  › 倒序浏览
  • 回答数

    0

  • 浏览数

    1432

  • 收藏数

    0

作者:稻香 发表于 2022-1-14 16:37:30
跳转到指定楼层
本帖最后由 稻香 于 2022-1-14 17:26 编辑


在实际的应用中,我们常常需要将最后的数值结构表示成三维图形。在使用MATLAB绘制三维图时,与二维图形的绘制有许多相似之处,其中属性的设置是完全相同的。常见的三维图形包括三维曲线、三维网格图和三维曲面图。

01
plot3()函数
Plot3 (x,y,z),其中x,y,z是三个相同长度的向量;
plot3(X,Y,Z),其中X,Y,Z是三个相同大小的矩阵;
plot3(X,Y,Z,s),其中s可对线条的属性进行设置
输入指令:
Plot3 (x,y,z), where x,y, and z are three vectors of the same length;
Plot3 (X,Y,Z), where X,Y, and Z are three matrices of the same size;
Plot3 (X,Y,Z,s), where s can set the attributes of the line
Input instruction:
02
peaks()函数
[x, y, z]=peaks(n):该函数产生3个矩阵x、y和z,大小都为n*n。
输入指令:
[x, y, z]= Peaks (n): This function generates three matrices x, y, and z, each of size n*n.

Input instruction:

03
mesh函数
mesh函数用于制作三维网格图,函数格式为mesh(x,y,z, c),x和y控制x轴和y轴,矩阵z为z轴数据,图形的颜色采用参数c设置。
The Mesh function is used to make 3D mesh graphs. The function format is Mesh (X, Y, Z, C). X and Y control X and Y axes.
04
surf()函数
Surf()函数用于绘制彩色的三维曲面图。在MATLAB中采用函数surfc()绘制带有等高线的三维曲面图,通过函数surfl()添加三维曲面的光照效果,调用方式和surf( )相同。
The Surf () function is used to draw color 3D curved surface diagrams. In Matlab, the function surfc() is used to draw a 3D surface graph with contour lines, and the illumination effect of 3D surface is added through the function surfl(), which is called in the same way as surf().
在MATLAB中采用函数surfc()绘制带有等高线的三维曲面图,通过函数surfl()添加三维曲面的光照效果,调用方式和surf( )相同。
Surfc()函数效果图:
In Matlab, the function surfc() is used to draw a 3D surface graph with contour lines, and the illumination effect of 3D surface is added through the function surfl(), which is called in the same way as surf().
Surfc() function renderings:
05
stem3()函数
在MATLAB中,三维柱状图、饼状图、火柴杆图等函数的调用格式和二维图的函数调用格式都非常相似,以火柴杆图为例:
In Matlab, the call format of functions such as 3D histogram, pie graph and matchstick graph is very similar to that of 2D graph. Take matchstick graph for example:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册 微信登录

x
分享:
回复

使用道具

成为第一个回答人

高级模式 评论
您需要登录后才可以回帖 登录 | 立即注册 微信登录
关于作者
稻香

用户组:版主

  • 主题

    5

  • 帖子

    6

  • 关注者

    1