creating discrete-pg电子麻将胡了
this example shows how to create discrete-time linear models using the tf, zpk, ss, and frd commands.
specifying discrete-time models
control system toolbox™ lets you create both continuous-time and discrete-time models. the syntax for creating discrete-time models is similar to that for continuous-time models, except that you must also provide a sample time (sampling interval in seconds).
for example, to specify the discrete-time transfer function:
with sampling period ts = 0.1 s, type:
num = [ 1 -1 ]; den = [ 1 -1.85 0.9 ]; h = tf(num,den,0.1)
h =
z - 1
------------------
z^2 - 1.85 z 0.9
sample time: 0.1 seconds
discrete-time transfer function.
or equivalently:
z = tf('z',0.1);
h = (z - 1) / (z^2 - 1.85*z 0.9);similarly, to specify the discrete-time state-space model:
with sampling period ts = 0.1 s, type:
sys = ss(.5,1,.2,0,0.1);
recognizing discrete-time systems
there are several ways to determine if your lti model is discrete:
the display shows a nonzero sample time value
sys.tsorget(sys,'ts')return a nonzero sample time value.isdt(sys)returns true.
for example, for the transfer function h specified above,
h.ts
ans = 0.1000
isdt(h)
ans = logical
1
you can also spot discrete-time systems by looking for the following traits:
time response plots - response curve has a staircase look owing to its sampled-data nature
bode plots - there is a vertical bar marking the nyquist frequency (pi divided by the sample time).
the following plots show these characteristic traits:
step(h)

bode(h), grid
