Discrete_time function

1 回表示 (過去 30 日間)
Adham Walid
Adham Walid 2023 年 3 月 11 日
回答済み: Sarvesh Kale 2023 年 4 月 19 日
  4 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 3 月 11 日
You have to state what problem you are facing. No one here is a mind-reader.
What is ustep? A function or a variable?
How did you define y(1) by that formula? No such formula is mentioned in the question.
Did you try to initialise "y(-1)=0" as stated in the problem?
John D'Errico
John D'Errico 2023 年 3 月 11 日
編集済み: John D'Errico 2023 年 3 月 11 日
Was it necessary to show only a picture of the code you wrote, instead of the code as text?
If you paste in the text itself, then someone can actually copy it to put into MATLAB to help you. When you insert a picture of your code, then you force someone to actually type it in by hand. Is there a good reason why you want to make it more difficult to get help?

サインインしてコメントする。

回答 (1 件)

Sarvesh Kale
Sarvesh Kale 2023 年 4 月 19 日
you can solve this using the following
I am assuming that u(n) is a step function in discrete domain
y0 = 1 ;
y = y0 ;
xn = 1 ; % this is always 1 since a step function
for i=1:100
tmp = 5*y0 + 1 ; %this implements the equation
y = [y , tmp] ;
y0 = tmp ; %store in this time step, use in next time step
end
% plot the results
figure ;
xlabel('n->');
ylabel('y[n]->');
stem([1:101],y);
when the indices are from 1 to 1000, it gives inf as value of tmp after some point
I hope this helps, next time please post your code so that we can edit it there
Thank you

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by