no..
i have long script for this..
but error still occur..
can you help check the error for me..
this is the whole script:
num=[ 1 ];
den=[1 3.236068 5.236068 5.236068 3.236068 1];
[z,p,k]=tf2zp (num,den);
for i=1: max (size(z)),
if real (z(i))>0,
z(i)=-2;
end
end
for i=2: max (size(p)),
if real (p(i))>0,
p(i)=-2;
end
end
[num1,den1]=zp2tf (z,p,k);
t=0:0.1:50;
[x,y,t]=step (num1,den1); grid
printsys (num1,den1);
num1/den1;
plot (t,x,'y'); grid
title ('plot unit langkah'); grid
hold;
pause;
[zm,pm]=minreal (z,p);
[a,b,c,d]=zp2ss (zm,pm,k);
[am,bm,cm,dm]=minreal (a,b,c,d);
[ab,bb,cb,g,t]=balreal (am,bm,cm);
elim=find (g<g(1)/10);
[ar,br,cr,dr]=modred (ab,bb,cb,d,elim);
elim=find (g<g(1)/5);
[ar1,br1,cr1,dr1]=modred (ab,bb,cb,d,elim);
[numm,denn]=ss2tf (ar,br,cr,dr);
[numm1,denn1]=ss2tf (ar1,br1,cr1,dr1);
[x,y,t]=step (ar,br,cr,dr); grid
printsys (numm,denn);
plot (t,x,'g'); grid
title ('plot unit langkah');
pause;
[x,y,t]=step (ar1,br1,cr1,dr1); grid
printsys (numm1,denn1);
numm1/denn1;
plot (t,x,'r'); grid
title ('plot unit langkah');
pause;
hold off
w=0:0.10:5;
[mag,phase,w]=bode (num1,den1);
subplot (211),semilogx (w/2*pi,20*log10(mag),'y'); grid
xlabel ('Frekuensi (Hz)'),ylabel ('dB');
title ('Bode Plot');
hold;
pause;
subplot (212),semilogx (w/2*pi,phase,'y'); grid
xlabel ('Frekuensi (Hz)'),ylabel ('Fasa');
title ('Bode Plot');
hold;
pause;
[mag,phase,w]=bode (numm,denn);
subplot (211),semilogx (w/2*pi,20*log10(mag),'g'); grid
xlabel ('Frekuensi (Hz)'),ylabel ('dB');
title ('Bode Plot');
pause;
subplot (212),semilogx (w/2*pi,phase,'g'); grid
xlabel ('Frekuensi (Hz)'),ylabel ('Fasa');
title ('Bode Plot');
pause;
[mag,phase,w]=bode (numm1,denn1);
subplot (211),semilogx (w/2*pi,20*log10(mag),'r'); grid
xlabel ('Frekuensi (Hz)'),ylabel ('dB');
title ('Bode Plot');
hold;
pause;
subplot (212),semilogx (w/2*pi,phase,'r'); grid
xlabel ('Frekuensi (Hz)'),ylabel ('Fasa');
title ('Bode Plot');
hold;
pause;