• Support PF! Buy your school textbooks, materials and every day products Here!

Is there a way to solve singular matrix on MATLAB

  • Thread starter Dell
  • Start date
  • #1
590
0
if i have a matrix which i singular, and i need to find a general solution to it, is there a way to do this using linsolve or any other command,

for example, if i have

2x+y=5
x+z=2
3x+y+z=7

is there any way i can get a solution of
x=x
y=5-2x
z=2-x
 

Answers and Replies

  • #2
The Electrician
Gold Member
1,246
152
Rearrange your matrix in reverse order:

Code:
  z y x
[ 0 1 2 ]
[ 1 0 1 ]
[ 1 1 3 ]
Then augment it:

Code:
  z y x
[ 0 1 2 5 ]
[ 1 0 1 2 ]
[ 1 1 3 7 ]
Then you need to calculate the Row Reduced Echelon Form:

Code:
  z y x
[ 1 0 1 2 ]
[ 0 1 2 5 ]
[ 0 0 0 0 ]
From this you can see that x=x (bottom row), and y = 5 - 2x (second row) and z = 2 - x (first row).
 

Related Threads for: Is there a way to solve singular matrix on MATLAB

  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
10
Views
1K
Replies
1
Views
872
Replies
1
Views
6K
Replies
3
Views
1K
Top