Torsten
Posts:
1,538
Registered:
11/8/10


Re: Alternative solution for NAN
Posted:
Feb 27, 2013 4:58 AM


"Carl S." wrote in message <kgki2g$rie$1@newscl01ah.mathworks.com>... > The following code gives NAN (Not a Number) values > [U,D]=eig(N); > > To solve this problem, I wrote that > while(det(N) == 0) > N=(1e10.*randi(1,size(N)))*eye(size(N)); > end > > But, the loop does not stop
Your matrix N within the loop always has determinant (1e10)^(size(N)) which may become very small if N is large.
:( Are there any alternative solution instead of this loop to solve the NAN problem ?
Depends on the original matrix N.
Best wishes Torsten.

