Write a MATLAB program to determine the response of the following system

1 回表示 (過去 30 日間)
Shamala Nagarajoo
Shamala Nagarajoo 2017 年 12 月 11 日
編集済み: Kian Azami 2017 年 12 月 11 日
Write a MATLAB program to determine the response of the following system
y(n) = 4.5x(n) + ay(n-1)
where a = 0.5 and the input signal x(n) is sinewave, x(n) = 3sin (2*pie*0.2n) Assume zero initial condition, y(-1) = 0. Plot y(n) for n= 1,2,.....200

回答 (1 件)

Kian Azami
Kian Azami 2017 年 12 月 11 日
編集済み: Kian Azami 2017 年 12 月 11 日
I think you can use the following code:
a = 0.5;
for n=1:200
x(n) = 3*sin(2*pi*0.2*n);
if n == 1
y(n) = 4.5*x(n);
else
y(n) = 4.5*x(n)+a*y(n-1);
end
end
figure
plot(y,'marker','.','markersize',10)
xlabel('n')
ylabel('y(n)')

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by