help-octave
[Top][All Lists]
Advanced

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

Re: test this in matlab for my please


From: Nicholas Jankowski
Subject: Re: test this in matlab for my please
Date: Wed, 13 Apr 2016 21:41:27 -0400


On Wed, Apr 13, 2016 at 10:39 AM, Doug Stewart <address@hidden> wrote:


On Wed, Apr 13, 2016 at 10:38 AM, Doug Stewart <address@hidden> wrote:

Please run this for me  in matlab.
I am getting close.



I took the liberty of switching your double quotes to to single quotes

>> clear
>> T=.1

T =

    0.1000

>> n=1

n =

     1

>> d=poly([-1+2j  -1-2j])

d =

     1     2     5

>> sys=tf(n,d)

sys =
 
        1
  -------------
  s^2 + 2 s + 5
 
Continuous-time transfer function.

>> out1=c2d(sys,T,'impulse')

out1 =
 
  0.008988 z + 2.994e-18
  ----------------------
  z^2 - 1.774 z + 0.8187
 
Sample time: 0.1 seconds
Discrete-time transfer function.

>> d=poly([-1+2j  -1-2j -1+2j  -1-2j ])

d =

     1     4    14    20    25

>> sys=tf(n,d)

sys =
 
                 1
  --------------------------------
  s^4 + 4 s^3 + 14 s^2 + 20 s + 25
 
Continuous-time transfer function.

>> out2=c2d(sys,T,'impulse')

out2 =
 
                                                 
  1.502e-05 z^3 + 5.415e-05 z^2 + 1.23e-05 z     
                                                 
                                       - 3.799e-20
                                                 
  ------------------------------------------------
                                                
   z^4 - 3.547 z^3 + 4.783 z^2 - 2.904 z + 0.6703
                                                
 
Sample time: 0.1 seconds
Discrete-time transfer function.

>> n=poly([-3-2j  -3+2j])

n =

     1     6    13

>> d=poly([-1+2j  -1-2j -1+2j  -1-2j ])

d =

     1     4    14    20    25

>> sys=tf(n,d)

sys =
 
           s^2 + 6 s + 13
  --------------------------------
  s^4 + 4 s^3 + 14 s^2 + 20 s + 25
 
Continuous-time transfer function.

>> out3=c2d(sys,T,'impulse')

out3 =
 
                                                 
  0.01085 z^3 - 0.01572 z^2 + 0.005936 z         
                                                 
                                       + 2.551e-18
                                                 
  ------------------------------------------------
                                                
   z^4 - 3.547 z^3 + 4.783 z^2 - 2.904 z + 0.6703
                                                
 
Sample time: 0.1 seconds
Discrete-time transfer function.

reply via email to

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