Plotting a Response of the Following system

2 views (last 30 days)
How can i plot the response of this system? ๐‘ฆ[๐‘›] = โˆ’๐‘ฆ[๐‘› โˆ’ 1] + 5๐‘ฅ[๐‘›] + 2๐‘ฅ[๐‘› โˆ’ 3]. From an input ๐‘ฅ[๐‘›] = [5, 1, 2, 3, 1, 0, 1, 2, โˆ’1, ]

Accepted Answer

Chunru
Chunru on 22 Sep 2021
% ๐‘ฆ[๐‘›] = โˆ’๐‘ฆ[๐‘› โˆ’ 1] + 5๐‘ฅ[๐‘›] + 2๐‘ฅ[๐‘› โˆ’ 3].
b = [5 0 0 2]; % 5x(n), 2x(n-3)
a = [1 1]; % y(n) + y(n-1)
% From an input ๐‘ฅ[๐‘›] = [5, 1, 2, 3, 1, 0, 1, 2, โˆ’1, ]
x = [5, 1, 2, 3, 1, 0, 1, 2, -1];
y = filter(b, a, x);
stem(y)
  1 Comment
John Doe
John Doe on 22 Sep 2021
Thank you very much for the fast and precise answer. More power to you.

Sign in to comment.

More Answers (0)

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!