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: Replacing `find` with logical indexing
Replies: 6   Last Post: Jul 10, 2013 1:47 PM

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: Replacing `find` with logical indexing
Posted: Jul 10, 2013 1:47 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 7/10/2013 9:55 AM, Jeff wrote:

> ... The inner parenthesis comparison, D~=0, is
> comparing floating point numbers in D to 0. If there is a very, very
> small value of D, say 1e-20, which really should be zero, I don't want
> that value returned. In your case, since I didn't specify how D was
> created, shouldn't you have included that?

Well, if that is the issue then yes. I presumed that ~=0 was intended
to be that by design/intent.

If you're indeed trying to exclude for some tolerance then indeed you do
need to make the comparison based on that.

Whether that's a constant or a percentage of the magnitude or just what
it is then is dependent upon the objectives.


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.