h(z)=2+10z^-1+2.3z^-2+3z^-3/1-78z^-1-9z^-2+59z^-3+1-31z^-1+16z^-2+4z/1-4z^-2-7z^-2
조회 수: 1 (최근 30일)
이전 댓글 표시
help me to write code
댓글 수: 3
Star Strider
2021년 10월 25일
Needs parentheses and multiplication operators —
z = tf('z', 'Variable','z^-1')
h = (2+10*z^-1+2.3*z^-2+3*z^-3)/(1-78*z^-1-9*z^-2+59*z^-3) + (1-31*z^-1+16*z^-2+4*z)/(1-4*z^-2-7*z^-2)
I have no idea what is causing the ‘Invalid text character’ error. You need to solve that.
I tested the essential code with another transfer function, and it works correctly otherwise.
.
ALESSIO LEREDE
2021년 10월 31일
Maybe you can try to define this transfer function with the function poles and zeros if you have issues in this form
답변 (1개)
Image Analyst
2021년 10월 31일
Try this:
z = linspace(0, 5, 200);
num1 = 10 .* z .^ (-1) + 2 .* z .^ (-2) + 3 .* z .^ (-3);
denom1 = 1-78*z.^(-1)-9*z.^(-2)+59*z.^(-3);
num2 = 1 - 31 * z.^(-1) - 16*z.^(-2)+4*z.^(-3);
denom2 = 1 - 4*z.^(-1)-7*z.^(-2);
h = 2 + num1 ./ denom1 + num2 ./ denom2;
plot(z, h, 'b-', 'LineWidth',2)
xlabel('z', 'FontSize', 17)
ylabel('h', 'FontSize', 17)
yline(0, 'LineWidth', 2)
grid on;
댓글 수: 1
Image Analyst
2021년 10월 31일
편집: Image Analyst
2021년 10월 31일
Not sure if the last term in numerator 2 is 4*z or 4*z^(-3) because the image is chopped off there. Please check. Here is is for 4z
z = linspace(0, 3, 200);
num1 = 10 .* z .^ (-1) + 2 .* z .^ (-2) + 3 .* z .^ (-3);
denom1 = 1-78*z.^(-1)-9*z.^(-2)+59*z.^(-3);
num2 = 1 - 31 * z.^(-1) - 16*z.^(-2)+4*z;
denom2 = 1 - 4*z.^(-1)-7*z.^(-2);
h = 2 + num1 ./ denom1 + num2 ./ denom2;
plot(z, h, 'b-', 'LineWidth',2)
xlabel('z', 'FontSize', 17)
ylabel('h', 'FontSize', 17)
yline(0, 'LineWidth', 2)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!