Errorbar vertical and horizontal

조회 수: 27(최근 30일)
LorD1991
LorD1991 2017년 1월 10일
답변: VBBV 2021년 10월 25일
Hi guys,
i tried to plot some errorbars using the following code:
x = [1 2 3 4 5 6 7 8 9 10];
y = [1 2 3 4 5 6 7 8 9 10];
err = [1 2 3 1 2 3 1 2 3 1];
errorbar (x,y,XData,'err',YData,'err',marker,'o')
But matlab says that XData is an undefined function.
Can someone help me please with my plots?

답변(2개)

Star Strider
Star Strider 2017년 1월 10일
It probably says that ‘XData’ is an ‘undefined funciton or variable’. You need to define it.
I doubt that is the problem, however. Your syntax for the errorbar (link) function (in the R2016b documentation) is wrong. Please re-read the documentation and re-write your errorbar call.

VBBV
VBBV 2021년 10월 25일
x = [1 2 3 4 5 6 7 8 9 10];
y = [1 2 3 4 5 6 7 8 9 10];
err = [1 2 3 1 2 3 1 2 3 1];
errorbar (x,y,'XData',err,'YData',err,'Marker','o')
Use of the 'XData' and 'YData' is incorrect as @Star Strider mentioned

태그

Community Treasure Hunt

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

Start Hunting!

Translated by