backward recurssion in a loop
이전 댓글 표시
Hi!
I would be grateful if anyone could help me with something similar to the following problem.
if
I have a matrix A=rand(n,a)
where n=9 and a=20
I have B=rand(1, 20)
I need to solve for C (n, a) which has to be solved backwards using A and B. The last row of C can be obtained by subtracting the last row of A from B. So, C(9,:)=B-A(9,:).
C(n-1,:) can be recovered by backward recurrsion so Now C(8, :)=C(9,:)-A(8,:) similarly C(7,:)=C(8,:)-A(8,:) and so forth and so on up to C(1,:)=C(2:)-A(2,:).
Can someone help with how can this be iterated in a loop?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!