输出图形纵坐标太小的问题
clear allclose all
Ts=0.2;
num1=;
den1=;
%num1=;
%den1=;
%num1=;
%den1=;
e=zeros(1,10);
u=zeros(1,10);
y=zeros(1,10);
x=zeros(1,3);
e1=zeros(1,10);
K=zeros(1,10);
w=;
r=1;
d=100;
k2=2.5;
ke=100;
kec=300;
kc=0.01;
kuf=0.1;
ks=0.002;
b1=0.8;
b2=0.15;
K_0=0;
for t=1:1:250;
time(t)=t*Ts;
e(1)=r-y(1);
e1(1)=e(1)-e(2);
E=round(ke*e(1));
Ec=round(kec*e1(1));
uf=kuf*round(b1*E+(1-b1)*Ec);
k3=ks*round(b2*E+(1-b2)*Ec);
x(1)=r;
x(2)=k2*e(1);
x(3)=x(2)+k3*e(1);
K(1)=K_0+kc*uf;
for i=1:1:10
K(i+1)=K(i)+kc*uf;
end
ss=0;
for i=1:1:3
ss=ss+(w(i));%w(1)+w(2)+w(3)
end
ifss==0;
ss=0.01;
end
kk=0;
for i=1:1:3
kk=kk+(w(i))*x(i);%w(1)x(1)+w(2)x(2)+w(3)x (3)
end
u(1)=K(1)*kk/ss;
u(2)=K(2)*kk/ss;
u(3)=K(3)*kk/ss;
u(4)=K(4)*kk/ss;
y(1)=-den1(2)*y(2)-den1(3)*y(3)+num1(2)*u(2)+num1(3)*u(3)+num1(4)*u(4);
for j=1:1:3
w(j)=w(j)+d*(r-y(1))*u(j)*x(1);
end
for z=10:-1:2
u(z)=u(z-1);
y(z)=y(z-1);
e1(z)=e1(z-1);
e(z)=e(z-1);
% K(z)=K(z-1);
end
yout(t)=y(1);
end
figure(1)
plot(time,yout,'r' );
grid on;
这个程序为什么输出的图形纵坐标那么小。我的输入是1.输出响应应该趋于1啊,是输出函数 y(1)那儿有错误吗?请高手给于帮助 ,谢谢。
[ 本帖最后由 eight 于 2007-7-26 16:38 编辑 ] 原帖由 daisy-622 于 2007-7-26 17:05 发表 http://www.chinavib.com/forum/images/common/back.gif
请大家给于帮助啊
如果是绘图问题,那么用 ylim 命令设置一下就可以;如果是专业问题,那么祝你好运,有这方面的高手路过
页:
[1]