I am trying to understand the formula
c=A(i:j,:)*inv(A)*b
where i,j=1:length(A)
. Assume that A is invertible
The above formula allow us copy all element from index i
to index j
in vector b
. I also implemented it by matlab code as follow code. However, I don't clearly understand why the above formula allow we copy elements in vector b
. Let see my formula and my implementation, please explain help me? Thank you so much
When I implement in matlab the code is
A =[ 10 1 7 10 9;
3 9 3 1 2;
9 2 3 5 4;
1 2 8 6 1;
5 2 6 6 10]
b =[ 8;
5;
8;
10;
6]
Then c=A(3:5,:)*inv(A)*b=[8;10;6]
The result looks like c=b(3:5,:);
More extention: Assume D is matrix 4 by 5 in which 1st to 3rd row are created from 3rd row to 5th row of A. The last row of D is ones. Then the above formula is
c(1:4,:)=D*inv(A)*b=[8;10;6;1.12]...
It also copy the 3rd to 5th elements of vector b