How to Solve recurrence equation

조회 수: 14 (최근 30일)
Jiby
Jiby 2022년 9월 17일
댓글: Jiby 2022년 9월 18일
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에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by