hey so i need to repeat the code everytime to see and analyze the time responses for 20 different values of k. How can i do it at once and have the output for all the values?
% Time response problme #3
% time response and pole zero plot
k=input(‘Enter the value of k’);
ng1=[k];dg1=[1];
ng=[20]; dg=[1 1 5];
[na, da]=series(ng,dg,ng1,dg1)
[num, den]=cloop(na,da)
sys=tf(num,den)
[z,p,k]=tf2zp(num,den)
subplot(1,2,1);step(sys,20e-1)
S = stepinfo(sys)
subplot(1,2,2); zplane(num,den)% Time response problme #3
% time response and pole zero plot
k=input(‘Enter the value of k’);
ng1=[k];dg1=[1];
ng=[20]; dg=[1 1 5];
[na, da]=series(ng,dg,ng1,dg1)
[num, den]=cloop(na,da)
sys=tf(num,den)
[z,p,k]=tf2zp(num,den)
subplot(1,2,1);step(sys,20e-1)
S = stepinfo(sys)
subplot(1,2,2); zplane(num,den) % Time response problme #3
% time response and pole zero plot
k=input(‘Enter the value of k’);
ng1=[k];dg1=[1];
ng=[20]; dg=[1 1 5];
[na, da]=series(ng,dg,ng1,dg1)
[num, den]=cloop(na,da)
sys=tf(num,den)
[z,p,k]=tf2zp(num,den)
subplot(1,2,1);step(sys,20e-1)
S = stepinfo(sys)
subplot(1,2,2); zplane(num,den) #loops #repeat #multiple inputs MATLAB Answers — New Questions