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 comentarios

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

Iniciar sesión para comentar.

 Respuesta aceptada

Sean de Wolski
Sean de Wolski el 30 de Ag. de 2012
Editada: Sean de Wolski el 30 de Ag. de 2012
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.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by