PDA

View Full Version : matlab help: inverse matrix


rajeshj
9th February 2005, 09:33 AM
hello,
when i do the inverse of a matrix in matlab, it comes like this.
>> s=[1 2 3;2 3 4;7 8 9]

s =

1 2 3
2 3 4
7 8 9

>> a=inv(s)
Warning: Matrix is singular to working precision.

a =

Inf Inf Inf
Inf Inf Inf
Inf Inf Inf

>>

why?

rocksea
9th February 2005, 10:22 AM
If you test the determinant by giving
>> det(s)
you'll get s=0

You'll get an inverse of matrix iff det(s) x 0
If det(s) = 0, inv(s) does not exist and is called a singular matrix.
The system may have infinitely many solutions or no solutions at all.

You can also use
>> cond(s)
and test to what extent it is singular.
Large conditions numbers indicates nearly singular matrix.
Test the above by substituting 1 with 2 in the matrix 's'.

rajeshj
9th February 2005, 11:10 AM
hello roxy,
this is a solved problem by someone else. please note

the following data show the number of bed rooms, the number of baths, and the prices at which a random sample of eight one family houses sold.

no bed rooms bath price
3 2 78800
2 1 74300
4 3 83800
2 1 74200
3 2 79700
2 2 74900
5 3 88400
4 2 82900



they fit a multiple regression equation and got the coefficients.

rocksea
9th February 2005, 11:15 AM
hi, i didn't get you properly :)
is this reply to the other thread on multiple regression equations?
also, it would be better if you elaborate on what are you discussing
in it.

rajeshj
9th February 2005, 11:55 AM
hello,
i actually got the problem solved. when two of us did it with diff matrixes, the answer was the same. but it was a mistake only. the data i gave was a solved problem on multiple regression. i could do that. sorry for trouble.