How to Solve recurrence equation

41 次查看(过去 30 天)
How to solve the recurrence equation
h[n]=-0.36*h[n-2]+1.2*h[n-1]
  1 个评论
Jiby
Jiby 2022-9-18
Thanks a lot @Star Strider. This helped me a lot to learn. I am very new to the matlab coding.

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2022-9-17
Try something like this —
h(1) = rand; % Initial Condition
h(2) = rand; % Initial Condition
N = 50;
for n = 3:N
h(n)=-0.36*h(n-2)+1.2*h(n-1);
end
nv = 1:N;
figure
plot(nv, h, '.-')
grid
xlabel('n')
ylabel('h')
Experiment to get the result you want.
.
  14 个评论
Torsten
Torsten 2022-9-18
编辑:Torsten 2022-9-18
I don't know your code, but as you can see above, plotting is possible.
nv and h are both vectors of size 1 x (10/T+1) (1 x 26 for T = 0.4).
101 smells like T = 0.1 while 26 smells like T = 0.4. I think you somehow mixed the two stepsizes for T in the h and nv arrays.
Jiby
Jiby 2022-9-18
I tried with T=0.1 without clearing workspace.
Thank you @Torsten

请先登录,再进行评论。

更多回答(1 个)

Walter Roberson
Walter Roberson 2022-9-17

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by