Why does Matlab give an error for axes?

Did anybody know why does Matlab give an error for axes?
Warning: line XData length (2) and YData length (0) must be equal
Thx, Sven_sight

댓글 수: 4

Star Strider
Star Strider 2012년 8월 30일
Are you using axes or axis? Please post the code that is giving the error.
Jan
Jan 2012년 8월 30일
Posting the small relevant part of the code, which reproduces the problem, would be helpful.
sven_sight
sven_sight 2012년 8월 30일
편집: sven_sight 2012년 8월 30일
I've using both axes and axis. The process run smoothly but in the end the warning sign appears.
figure(1); width=0.38; height=0.35; h1=axes('position',[0.6 .55 width height],'box','on','xcolor','k','ycolor',... 'k'); set(gcf,'color', 'w')
inputv=Q22; qstart=min(inputv); qstop=max(inputv); axes(h1); axis([qstart qstop min(Q44) max(Q44)]);
Thanks,
Star Strider
Star Strider 2012년 8월 30일
The plot(X,Y) command might also be informative, as well as the sizes of X and Y. I may be missing something, but I don't see an error in what you've posted.

댓글을 달려면 로그인하십시오.

 채택된 답변

Sean de Wolski
Sean de Wolski 2012년 8월 30일
편집: Sean de Wolski 2012년 8월 30일

2 개 추천

It's not a warning for the axes, it's a warning for the line and it means exactly what it says! You can't have a line with two xdata and three ydata since they don't line up!
Consider this:
plot(1:10,1:12)
It doesn't work for the same reason.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by