t = 0:1e-3:10;
u = ones(size(t));
y = zeros(5,length(t));
for k=1:5
H = (1 + tf('s')*5/k)^k; % system transfer function
CL = 1/((tf('s'))^2*(1-H)); % closed-loop transfer function
y(k,:) = (lsim(CL,u,t))';
end
plot(t,y)
legend('#1','#2','#3','#4','#5','Location','NorthWest')
grid on
xlabel('Time [s]')
ylabel('Output')
1 回答
除非我误解了你的问题,否则我不会尝试这样做,它可以在普通的MATLAB中完成(使用control system toolbox):
产生以下图(在Octave中) . 只有前2次迭代才会给出非零输出: