Creating discrete-time model
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jasmina Zukorlic
el 28 de Mayo de 2018
Comentada: Star Strider
el 29 de Mayo de 2018
Hello, can someone please tell me what am I doing wrong in writing this expression in MATLAB:
This is the result I'm obtaining: H =
8 z^5 - 5 z^4 - 4 z^3 + z^2 + 3 z - 2
----------------------------------------------------------------------
0.0648 z^6 + 0.1134 z^5 - 0.6184 z^4 + 1.436 z^3 - 1.7 z^2 + 1.6 z - 1
And here is my code:
Nd=[-8 5 4 -1 -3 2];
Dd=[-0.0648 -0.1134 0.6184 -1.436 1.7 -1.6 1 ];
P=Nd;Q=Dd;
H = tf(P,Q,0.1)
1 comentario
Star Strider
el 29 de Mayo de 2018
If you want to code the transfer function in the image you posted, you need to enter the coefficients in the correct order. Here, that means using fliplr (since I do not want to re-type the vectors):
Nd = [-8 5 4 0 -1 -3 2];
Dd = [-0.0648 -0.1134 0.6184 -1.436 1.7 -1.6 1 ];
P = fliplr(Nd);
Q = fliplr(Dd);
H = tf(P,Q,0.1,'variable','z^-1')
H =
2 - 3 z^-1 - z^-2 + 4 z^-4 + 5 z^-5 - 8 z^-6
------------------------------------------------------------------------------
1 - 1.6 z^-1 + 1.7 z^-2 - 1.436 z^-3 + 0.6184 z^-4 - 0.1134 z^-5 - 0.0648 z^-6
Sample time: 0.1 seconds
Discrete-time transfer function.
Respuesta aceptada
Abraham Boayue
el 28 de Mayo de 2018
Use this line of code to get a negative exponent.
H = tf(P,Q,0.1,'variable','z^-1');
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Dynamic System Models en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!