필터 지우기
필터 지우기

How to get data from figures produced by errorbars?

조회 수: 25 (최근 30일)
Mateusz
Mateusz 2011년 4월 16일
I have a figure which was produced by using errorbars command. It plots the mean data and corresponding error bars.
Now I would like to obtain all data from this figure.
I can easily get the mean data by:
openfig(figName);
xData = get(get(gca, 'Children'), 'XData');
yData = get(get(gca, 'Children'), 'YData');
However, I still don't know how to obtain data about error bars.
May I get some advice on this?

채택된 답변

Paulo Silva
Paulo Silva 2011년 4월 16일
%example data
X = 0:pi/10:pi;
Y = sin(X);
E = std(Y)*ones(size(X));
errorbar(X,Y,E)
%get data
xData = get(get(gca, 'Children'), 'XData');
yData = get(get(gca, 'Children'), 'YData');
uData = get(get(gca, 'Children'), 'UData');
%lets see if its equal
isequal(E',uData) %it is equal, same content

추가 답변 (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