matlab条形图添加误差线,如何在MATLAB中绘制带有标准偏差值的误差线图?

I am very new to MATLAB and expect a step-by-step solution. I have data, series(y), which I have to plot against (x). Also I have the standard deviation values for each data point of (y). Now I have to plot these series highlighting the error bars. How can I do that?

The data is in a text file sorted in columns as:

X = -50, -49, -48, -47....0....1, 2, 3, 4, 5....till 50

Y = 1.2, 1.0, 1.1, 1.9, 1.3.....

Standard deviation = 0.6, 0.5, 0.3, 0.6, 0.6.....

Also, how do I control the ticks and appearance property for these kinds of graphs?

解决方案x = 1:0.1:10;

y = sin(x);

e = 0.1 * randn(length(x), 1);

errorbar(x,y,e)

set(gca, 'Xlim', [4 10])

set(gca, 'XTick', 4:2:10)

336956feac85cc0b68206b3d91b64744.png

See also get(gca) and get(gcf) for other properties to change.

For help on any of these functions, do, for example, help errorbar.

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值