When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T, and as many columns as input channels.

6 views (last 30 days)
e=0.09119
wn=69.79
num=wn*wn
den=[1 2*e*wn wn*wn];
g=tf(num,den);
t=0:0.05:5
u=zeros(size(t)-1);
u=[1,u];
y=lsim(num,den,u,t);
plot(t,y)

Answers (1)

Birdman
Birdman on 22 May 2018
Try the following code. By the way, I did not understand why you gave zeros as input, therefore I changed it with ones vector:
e=0.09119;
wn=69.79;
num=wn*wn;
den=[1 2*e*wn wn*wn];
g=tf(num,den);
t=[0:0.05:5].';t=t(1:100);
u=ones(max(size(t)),1);
y=lsim(num,den,u,t);
plot(t,y)

Tags

Community Treasure Hunt

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

Start Hunting!