help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question on control-1.0.11 package


From: Lukas Reichlin
Subject: Re: question on control-1.0.11 package
Date: Sat, 24 Apr 2010 16:53:21 +0200

If you look at the m-file [1] of tf2zp, the reason is obvious:

k = num(1) / den(1);

Because your numerator num has leading zeros, Octave calculates

k = 0 / 1

Use num = [1] and you will get the correct result.

Regards,
Lukas

[1]
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-legacy/inst/tf2zp.m?revision=6995&view=markup

On 4/24/10 3:40 PM, Francesco Potortì wrote:
Edit: by another calculation using tf2zp the difference between Octave and Matlab shows again. Octave returns for k = 0, while Matlab returns
for k = 100.

I don't think that it is possible to understand what is going on without
code.  Can you provide an example?


Sure.

num = [0 0 0 100];
den = [1 10.1 101 0];
[z,p,k] = tf2zp(num, den);

Octave gives:

octave-3.2.3:7> [z,p,k] = tf2zp(num, den)
z = [](0x1)
p =

  -5.05000 + 8.68893i
  -5.05000 - 8.68893i
   0.00000 + 0.00000i

k = 0

Matlab gives:

[z,p,k] = tf2zp(num, den)

z =

   Empty matrix: 0-by-1


p =

        0
  -5.0500 + 8.6889i
  -5.0500 - 8.6889i


k =

   100

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave




reply via email to

[Prev in Thread] Current Thread [Next in Thread]