octave-maintainers
[Top][All Lists]

## Re: run this in matlab for me

 From: Kai Torben Ohlhus Subject: Re: run this in matlab for me Date: Sat, 13 Apr 2019 17:50:59 +0900

On Sat, Apr 13, 2019 at 6:02 AM Doug Stewart <address@hidden> wrote:

One more try .

q1=((z^3-2*z^2+3*z+7)/(z +13))
aq=q1'
minreal(aq)
aq'
aaq=tf(ss(q1)')
q2=aaq'
minreal(q2)

--
DAS

I added "z = tf('z',1)" as first line according to an older post by you (https://lists.gnu.org/archive/html/octave-maintainers/2019-04/msg00089.html), this avoid the undefined "z" error.

The output for R2019a is:

z =

z

Sample time: 1 seconds
Discrete-time transfer function.

q1 =

z^3 - 2 z^2 + 3 z + 7
---------------------
z + 13

Sample time: 1 seconds
Discrete-time transfer function.

aq =

7 z^3 + 3 z^2 - 2 z + 1
-----------------------
13 z^3 + z^2

Sample time: 1 seconds
Discrete-time transfer function.

ans =

0.5385 z^3 + 0.2308 z^2 - 0.1538 z + 0.07692
--------------------------------------------
z^3 + 0.07692 z^2

Sample time: 1 seconds
Discrete-time transfer function.

ans =

z^3 - 2 z^2 + 3 z + 7
---------------------
z + 13

Sample time: 1 seconds
Discrete-time transfer function.

aaq =

0.5385 z^4 + 0.2308 z^3 - 0.1538 z^2 + 0.07692 z + 5.406e-19
------------------------------------------------------------
z^4 + 0.07692 z^3

Sample time: 1 seconds
Discrete-time transfer function.

q2 =

5.406e-19 z^4 + 0.07692 z^3 - 0.1538 z^2 + 0.2308 z + 0.5385
------------------------------------------------------------
0.07692 z + 1

Sample time: 1 seconds
Discrete-time transfer function.

ans =

7.028e-18 z^4 + z^3 - 2 z^2 + 3 z + 7
-------------------------------------
z + 13

Sample time: 1 seconds
Discrete-time transfer function.

Best,
Kai