OK, I've managed to do it!
z=poly(0,'z'); //Defines z to be a polynomial variable
sys=syslin('d',<H(z)>);
fmin=0.001;
fmax=0.5;
scf(1);clf;
bode(sys,fmin,fmax); //Plots frequency response in Bode diagram
davew - 03 Jul 2009 13:57 GMT
The only problem I have now is that if I define the system to have
complex conjugate poles and zeros (so they should cancel out to
provide a real function), plot won't work. It says it expects a real
matrix. Is there a way around this other than multiplying out the
function and removing the complex terms ?
Tim Wescott - 04 Jul 2009 07:31 GMT
> The only problem I have now is that if I define the system to have
> complex conjugate poles and zeros (so they should cancel out to provide
> a real function), plot won't work. It says it expects a real matrix.
> Is there a way around this other than multiplying out the function and
> removing the complex terms ?
Try this:
real((%z - 0.9 + %i * 0.1) * (%z - 0.9 - %i * 0.1));
Scilab 'marks' a variable as complex, and this gets preserved sometimes
even if the imaginary part is zero -- taking the real part marks the
result as -- well -- real.

Signature
http://www.wescottdesign.com
davew - 04 Jul 2009 11:13 GMT
> > The only problem I have now is that if I define the system to have
> > complex conjugate poles and zeros (so they should cancel out to provide
[quoted text clipped - 11 lines]
>
> --http://www.wescottdesign.com
Thanks for that.
Tim Wescott - 04 Jul 2009 07:27 GMT
> OK, I've managed to do it!
>
[quoted text clipped - 8 lines]
>
> bode(sys,fmin,fmax); //Plots frequency response in Bode diagram
%z is predefined. Please quote the original message, even if it's you.

Signature
http://www.wescottdesign.com