Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Alternative solution for NAN
Replies: 11   Last Post: Feb 27, 2013 5:44 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tony Kittler

Posts: 105
Registered: 2/5/11
Alternative solution for NAN
Posted: Feb 27, 2013 4:02 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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=(1e-10.*randi(1,size(N)))*eye(size(N));
end

But, the loop does not stop :( Are there any alternative solution instead of this loop to solve the NAN problem ?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.