The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: -1.#IND00 in matlab
Replies: 13   Last Post: Jan 3, 2013 8:17 AM

Advanced Search

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

Posts: 9,850
Registered: 6/7/07
Re: -1.#IND00 in matlab
Posted: Jan 3, 2013 8:17 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/3/2013 1:05 AM, Bruno Luong wrote:
> majeti dinesh <> wrote in message
> <>...

>> Can you explain with some code as to how to use try...catch?
> I think try/catch suggestion is not good, Inf and NaN result from an
> arithmetic expression is not an error, thus cannot be catch.

Yeah, I realized that later...a shortcoming in Matlab that can't set FP
error condition flag dynamically for such things... :(

OP -- you'll just have to catch the problem case of u1==1 and make a
fixup either before or after depending on what you want/need.

You could just generate the variate then replace NaN or Inf w/ another
value or test the rnv u1 and reject the value 1 before the
computation--your choice again depending on the need.

It's only the u1==1 that is causing the problem if the previous case is
the only place like this in your code--try


at the command line to understand...


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.