如何在matlab中带画有置信边界的线图

手把手教学。

工具/原料

  • matlab
  • 电脑

方式/步骤

  1. 1

    利用 fill 函数绘制置信鸿沟,同时利用 plot 函数绘制数据点,以此体例建立含有置信鸿沟的画图。利用圆点暗示法语法 object.PropertyName 自界说画图的外不雅。

  2. 2

    号令行键入:

    x = 0:0.2:10;

    054056fe1e425d6bb349949b11883913e9e5002f.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  3. 3

    号令行键入:

    y = besselj(0, x);

    49701aebf6a75f0f69b3a95c97324b18502c4c2f.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  4. 4

    号令行键入:

    xconf = [x x(end:-1:1)] ;

    6bbfdd14f1c595ee5c586a9527530688902c9a2f.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  5. 5

    号令行键入:

    yconf = [y+0.15 y(end:-1:1)-0.15];

    939c2d40b6f391874985447224fce186252fef2f.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  6. 6

    号令行键入:

    figure

    fab31cb375d7997bdb6d07eaf9dade49600fd92f.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  7. 7

    号令行键入:

    p = fill(xconf,yconf,'red');

    ce26355fd54605962c8d29623e03c8d247fe252c.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500b442d6d246fe474e581aee0db0ef354f51b81f2c.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  8. 8

    号令行键入:

    p.FaceColor = [1 0.8 0.8];

    6834ecc4ec995943b798954c95425d6b05d1042c.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  9. 9

    号令行键入:

    p.EdgeColor = 'none';

    e1390a31dfb6326c80ff447d89532f632285602c.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  10. 10

    号令行键入:

    hold on

  11. 11

    号令行键入:

    plot(x,y,'ro')

    4a594f2c8cf1d8a7d4aa953646e34b2c57ee472c.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500
  12. 12

    号令行键入:

    hold off

  • 发表于 2020-04-09 17:01
  • 阅读 ( 388 )
  • 分类:其他类型

相关问题

0 条评论

请先 登录 后评论