pancho_hideboo
Advanced Member level 5
- Joined
- Oct 21, 2006
- Messages
- 2,847
- Helped
- 767
- Reputation
- 1,536
- Reaction score
- 733
- Trophy points
- 1,393
- Location
- Real Homeless
- Activity points
- 17,490
Code:
A = [ 1, 2, -1, -2, -3;
2, 4, 0, -3, -1;
1, 2, 1, 0, 1;
3, 6, -2, -5, -7;
2, 4, -3, -5, -8]
b = [6, 7, 2, 16, 14].'
size(A)=5x5
rank(A)=3
det(A)=0
So A*x = b does not have unique solution.
Solution x is x = d + t1*c1 + t2*c2.
Here
d = [5, 0, -3, 1, 0].'
c1 = [-2, 1, 0, 0, 0].'
c2 = [2, 0, -3, 1, 1].'
t1 and t2 are any values.
How can I get this solution by MATLAB ?
Solution by pseudo inverse matrix of A gives following.
Code:
pinv(A)*b
=>
0.5932
1.1864
0.0508
-0.0169
-1.0169
Last edited: