ti系统对输入的响应
matlab命令lsim使给定系统函数H(s),计算一个LTI系统对输入x(t)的响应更加方便。设
我们要求出对输入)()2cos()(tuttxπ=的响应。下面的脚本计算了响应,并绘制出图像。
figure(1);
num = [5 0]; %Define numerator polynomial
14
den = [1 2 101]; %Define denominator polynomial
t = linspace(0, 10, 401); %Define a time vector
u = cos(2*pi*t); %Compute the cosine input function
[y, x] = lsim(num, den, u, t); %Compute the cosine input function
plot(t, y, ‘r’, t, u, ‘b’); %Plot the output in red and the input in blue
xlabel(‘Time(s)’);
ylabel(‘Amplitude’);
图像如图6所示。
0