Why does MATLAB give an error on an axes plot when I change with new variable (a22) in my formula??

Error using set Bad property value found. Object Name : axes Property Name : 'YLim' Values must be increasing and non-NaN.
Error in axis>LocSetLimits (line 208) set(ax,...
Error in axis (line 94) LocSetLimits(ax(j),cur_arg);
end
Error in fourbar (line 395)
axis([qstart qstop min(a22) max(a22)]);

 채택된 답변

Sven
Sven 2012년 8월 29일
편집: Sven 2012년 8월 29일
Hi Sven (nice name, btw)
Replace the one line:
axis([qstart qstop min(a22) max(a22)]);
With the two lines:
disp([qstart qstop min(a22) max(a22)])
axis([qstart qstop min(a22) max(a22)]);
And then re-run your code. I bet that the last thing before it errors will tell you is that your max(a22) is equal to min(a22).
After that you can probably replace it with:
padding = 0.5; % Just some number that gives you a reasonable axis size
axis([qstart qstop [min(a22) max(a22)] + [-1 1]*padding]);
Thanks, Sven.

댓글 수: 1

Hi Sven(looks like we have same name)
I've tried your suggestion and it happened exactly as you said. On the other hand, I have an array of data alpha2 inserted into the loop.
a22=alpha2*pi/180; disp(' Loading ... '); fprintf('fourbar.dat');
assem=para(29); j=0; if assem==1 i=i+1; a22(i)=para(14); % alpha 2
Do you have any other solution array is why the data is not readable?
Thanks Sven,

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

질문:

2012년 8월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by