I have a matrix M which have 576 rows and 15 columns.First column is all 1. Second column starts from 1, increasing one by one to 576. Third column is square of second column. Fourth column is third power of second column. Fifth column is fourth power of second column. It goes like this. Finally fifteenth column is fourteenth power of second column. The operation is to multiply the transpose of matrix M with itself and taking inverse of the result. However Matlab give warning like this; Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.889839e-79. Is it a way of taking inverse of it? I also tried this operator \ but same warning occurs.
Asked
Active
Viewed 704 times
0
-
`RCOND = 1.889839e-79`? I've never seen a number that low... Anyway, it's because the determinant is very close to zero. Have a look at `pinv` or `svd`. – Stewie Griffin Oct 14 '16 at 10:39
-
2Question to "how to invert a matrix" -> A: You dont! What do you need the inverse of the matrix for? Generally you can do it without computing the explicit inverse – Ander Biguri Oct 14 '16 at 10:46
-
1Possible duplicate of [how to compute inverse of a matrix accurately?](http://stackoverflow.com/questions/36166599/how-to-compute-inverse-of-a-matrix-accurately) – Adriaan Oct 14 '16 at 10:57
-
Whilst the duplicate is true for the general case of taking inverses of matrices in MATLAB, the answer by Gabe is a lot better in this specific case, since it can be calculated analytically. Please [edit] the question to take into account that this is a so-called Vandermonde's matrix, after which the duplicate won't apply anymore. – Adriaan Oct 14 '16 at 11:25
-
@Stewie pind don't give the result as I expected. – Deniz Baturay Oct 14 '16 at 13:30
-
@Adriaan mldivide gives same warning in matlab. – Deniz Baturay Oct 14 '16 at 13:37
1 Answers
5
Vandermonde's Matrix has an analytic inverse form here:
https://proofwiki.org/wiki/Inverse_of_Vandermonde_Matrix
In order to avoid Matlab's inversion, you can manually use this inverse and then multiply it by its transpose and you'll get the same expression.
You can also use this analytic form in order to analyze and understand better why would your matrix be ill-conditioned (check for exploding poles).

Gabizon
- 339
- 4
- 15
-
I'm not taking inverse of M. I'm taking inverse of M's transpose multiply M. – Deniz Baturay Oct 14 '16 at 13:30
-
Right,That's why I told you to "use this inverse **and then multiply it by its transpose**" (basic matrix properties) – Gabizon Oct 14 '16 at 14:06
-