backward recurssion in a loop
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!