• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

MATLAB二维平面绘图 - codeDog123

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

MATLAB二维平面绘图

plot - 2-D line plot

    This MATLAB function creates a 2-D line plot of the data in Y versus the
    corresponding values in X.If X and Y are both vectors, then they must have equal
    length and MATLAB plots Y versus X.If X and Y are both matrices, then they must
    have equal size and MATLAB plots columns of Y versus columns of X.If one of X or
    Y is a vector and the other is a matrix, then the matrix must have dimensions
    such that one of its dimensions equals the vector length.

    plot(X,Y)
    plot(X,Y,LineSpec)
    plot(X1,Y1,...,Xn,Yn)
    plot(X1,Y1,LineSpec1,...,Xn,Yn,LineSpecn)
    plot(Y)
    plot(Y,LineSpec)
    plot(___,Name,Value)
    plot(axes_handle,___)
    h = plot(___)
注释:
对于X和Y,可以有以下几种参数形式
(1)X是向量(行向量或列向量),Y是向量(行向量或列向量),并且length(x)==length(y)。
(2)X,Y是M*N的矩阵,Y中的每一列元素为纵坐标,绘制N条曲线。第一条曲线我的坐标为:[x11,y11],[x12,y12],..[x1M,y1M]
(3)X是向量,Y是函数。绘制出Y=F(X)的函数图。
举例1:
x=[1,3,5,6]
y=[0.1,0.2,0.3,0.4]
plot(x,y)
举例2:
x=[1,5,9;2,4,8]
y=x
plot(x,y)
%绘制出三段曲线
第一段曲线:(1,1),(2,2)
第二段曲线:(5,5),(4,4)
第三段曲线:(8,8),(9,9)

举例3:
x=[0:pi/10:2*pi]  %[0,2*pi]间隔为pi/10的向量
y-sin(x)
plot(x,y)

添加图像标题:title(\'标题\')

添加横坐标提示: xlabel(\'横坐标提示\')

添加纵坐标提示: ylabel(\'纵坐标提示\')

在坐标位置添加提示:text(x,y,\'提示\')  %x为横坐标,y为纵坐标

 绘制网格    grid

LineSpec用字符串来表示,例如\'-.\'代表点和实线,\'-.*\'代表实现实线,点,星号


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Matlab入门教程-二维绘图[z] - 白途思发布时间:2022-07-18
下一篇:
matlab神经网络多分类(模式识别神经网络nprtool)发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap