
求助:matlab中用lsim求任意输入的响应曲线时报错。
n=[0.01,3];d=[1.33/10^4,0.028,3];sys=tf(n,d);t=0:0.005:2;u=cos(t)/sin(t);[y,t]=lsim(s...
n=[0.01,3];d=[1.33/10^4,0.028,3];
sys=tf(n,d);
t=0:0.005:2;
u=cos(t)/sin(t);
[y,t]=lsim(sys,u,t);plot(t,y);hold;plot(t,u,'r')
Error using ==> lti.lsim at 81
When simulating the response to a specific input signal, the input data U must be a matrix of real values with at least two
rows (samples) and without any NaN or Inf.
Error in ==> test at 6
[y,t]=lsim(sys,u,t);plot(t,y);hold;plot(t,u,'r')
我把输入改成u=cos(t)+sin(t);就完全没问题。但是乘或除就报错。为啥? 展开
sys=tf(n,d);
t=0:0.005:2;
u=cos(t)/sin(t);
[y,t]=lsim(sys,u,t);plot(t,y);hold;plot(t,u,'r')
Error using ==> lti.lsim at 81
When simulating the response to a specific input signal, the input data U must be a matrix of real values with at least two
rows (samples) and without any NaN or Inf.
Error in ==> test at 6
[y,t]=lsim(sys,u,t);plot(t,y);hold;plot(t,u,'r')
我把输入改成u=cos(t)+sin(t);就完全没问题。但是乘或除就报错。为啥? 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询