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 Kommentare

Star Strider
Star Strider am 30 Aug. 2012
Are you using axes or axis? Please post the code that is giving the error.
Jan
Jan am 30 Aug. 2012
Posting the small relevant part of the code, which reproduces the problem, would be helpful.
sven_sight
sven_sight am 30 Aug. 2012
Bearbeitet: sven_sight am 30 Aug. 2012
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 am 30 Aug. 2012
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.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 30 Aug. 2012
Bearbeitet: Sean de Wolski am 30 Aug. 2012

2 Stimmen

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.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by