Error bar for a set of values
1 次查看(过去 30 天)
显示 更早的评论
y=[53.3654 16.6489 40.9854 21.7873];
error=[7.3822 4.1028 5.1562 1.2531];
Need to plot bar graph with the error bars corresponding to the values in error.
0 个评论
采纳的回答
Ayush Modi
2024-5-16
编辑:Ayush Modi
2024-5-16
Hi Viswajit,
You could achieve this using the functions bar to create a bar graph and errorbar to add the error bars. Here is how you can achieve it:
y = [53.3654 16.6489 40.9854 21.7873];
error = [7.3822 4.1028 5.1562 1.2531];
bar(y)
hold on
numBars = numel(y);
x = 1:numBars;
errorbar(x, y, error, '.')
Please refer to the following MathWorks documentation for more information on:
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Errorbars 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!