Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get rid of Nan in Pseudo-inverse matrix

268 views
Skip to first unread message

Mahmoud Zeydabadinezhad

unread,
Oct 2, 2009, 2:54:03 PM10/2/09
to
Hi all,
To solve a system of linear equations I have to compute the matrix inverse. I did use both the inv(A'*A)*A' and pinv(A) but in all cases I got some NaNs.
I read some related posts here but finally couldn't come up with a consistent answer to my questions?
Does anybody know another method for solving a system of linear equations?
Is there anyway to avoid this NaNs in matrix inverse computing ?

Thank you,

Bruno Luong

unread,
Oct 2, 2009, 3:02:03 PM10/2/09
to
"Mahmoud Zeydabadinezhad" <zeyd...@yahoo.com> wrote in message <ha5i8b$frr$1...@fred.mathworks.com>...

Does your matrix contain NaN?

Check with the command
find(isnan(A(:)))

Bruno

Mahmoud Zeydabadinezhad

unread,
Oct 2, 2009, 4:12:03 PM10/2/09
to
> Does your matrix contain NaN?
>
> Check with the command
> find(isnan(A(:)))
>
> Bruno
No, The original matrix A, doesn't have any NaN value. the result of pinv(A) or pseudo inverse matrix of A have some NaN values.

Bruno Luong

unread,
Oct 2, 2009, 4:24:04 PM10/2/09
to
"Mahmoud Zeydabadinezhad" <zeyd...@yahoo.com> wrote in message <ha5mqj$gou$1...@fred.mathworks.com>...

> No, The original matrix A, doesn't have any NaN value. the result of pinv(A) or pseudo inverse matrix of A have some NaN values.

Strange. I think it is a bug.

Try then my PSEUDOINVERSE of Fex if your Matlab has oriented object feature:

http://www.mathworks.com/matlabcentral/fileexchange/25453

Bruno

Bruno Luong

unread,
Oct 3, 2009, 2:35:02 AM10/3/09
to
What this command gives?

norm(A,'fro')

Bruno

Tim Davis

unread,
Oct 3, 2009, 5:32:01 PM10/3/09
to
"Mahmoud Zeydabadinezhad" <zeyd...@yahoo.com> wrote in message <ha5i8b$frr$1...@fred.mathworks.com>...

Why compute the inverse to solve a linear system? inv(A'*A)*A' is a really bad way to solve the normal equations. Just use x=A\b.

0 new messages