问题描述
对于 MATLAB ,我是一个非常陌生的人,期待逐步解决方案.我有数据series(y)
,必须针对(x)
进行绘制.另外,我还具有(y)
的每个数据点的标准偏差值.现在,我必须绘制这些系列以突出显示误差线.我该怎么办?
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.....
标准偏差= 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)
有关其他属性的更改,另请参见get(gca)
和get(gcf)
.
See also get(gca)
and get(gcf)
for other properties to change.
例如,要获取有关任何这些功能的帮助,请执行help errorbar
.
For help on any of these functions, do, for example, help errorbar
.
这篇关于如何在MATLAB中绘制带有标准偏差值的误差线图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!