필터 지우기
필터 지우기

Error bar for a set of values

조회 수: 1 (최근 30일)
Viswajit Talluru
Viswajit Talluru 2024년 5월 16일
댓글: Viswajit Talluru 2024년 5월 16일
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.

채택된 답변

Ayush Modi
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 CenterFile Exchange에서 Errorbars에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by