Matlab Flashcards
How do you find the closed loop TF, Gc(s)
Gc=feedback(G*M,1)
This is the TF btw r (target) and y with compensator M
How do you find poles of a closed-loop system?
[poles, zeros]=pzmap(Gc)
How do you find close-loop s-s gain
Gc0 = bode(Gc,0)
don’t seem to work, ask
How to see figure of o/p response to change in r.
step(Gc)
How to find poles and residues of a fraction (partial fractions)
Eg:
num=[10]
den=[ 1 5 6]
[r poles k]= residue(num,den)
How to convert back from partial fractions to just one merged fraction?
[num den]= residue(r, poles, k)
If G=2 /( s +1 )( s + 5 ) how would you compute it on MATLAB w/out expanding the brackets
G= tf ( 2, poly ( [-1 -5] ) )
How to find s-s gain
g=bode(G,0)
It basically does G(0) for you - pretty sure
How to find coefficients of a high order polynomial if don’t want to expand it all yourself? Eg: ( s+1 )( s+5)(2+3)
poly( [-1 -5 -3] )
ans= 1 9 23 15
How to find roots of a polynomial?
roots( [1 5 6] )
to extract num and den from tf
[num den]=tfdata(G,’v’)