How to plot this model in MATLAB script

조회 수: 9 (최근 30일)
Richard Fitzpatrick
Richard Fitzpatrick 2017년 4월 14일
답변: Star Strider 2017년 4월 14일
I have an output error model: y(t)=(0.006559z^-1 - 0.005439z^-2)/(1-1.893z^-1 + 0.8988z^-2) u(t) How would this be plotted using a MATLAB script? I assume it would involve using vectors to represent t and u, but am unsure how the equation would be represented.

답변 (1개)

Star Strider
Star Strider 2017년 4월 14일
You need to use the Control System Toolbox tf function (supply the correct sampling interval to get the correct plots):
% % H(z) = (0.006559z^-1 - 0.005439z^-2)/(1-1.893z^-1 + 0.8988z^-2)
Ts = -1; % Unknown Sampling Time Interval = ‘-1’
num = [0 0.006559 -0.005439];
den = [1 -1.893 0.8988];
sys = tf(num, den, Ts, 'Variable','z^-1'); % Create System Object
figure(1)
bode(sys)
This plots the Bode plot. You can plot others once you create the system object. You can also convert to other forms, such as state-space. See the documentation on the various functions for details.

카테고리

Help CenterFile Exchange에서 Response Computation and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by