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: Problem with the find function
Replies: 2   Last Post: May 20, 2012 4:12 PM

Advanced Search

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

Posts: 5,064
Registered: 2/7/05
Re: Problem with the find function
Posted: May 20, 2012 3:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 5/20/2012 2:46 PM, Neriya Cohen wrote:
> Hi,
> I defined a vector x with length of 2001: (x=-1:10^-3:1)
> if I write z=find(x==0.936000000000000); (0.936000000000000 is indexed 1937), I
>get in z the value [], meaning no value (what I supposed to get
>is actually 1937). If I look for other numbers (z=find(x==0.895000000000000)
>for example), it works perfectly. Why does it happen? And how can I fix it?



EDU>> x=-1:10^-3:1; z=find(x==0.936000000000000)

Empty matrix: 1-by-0

EDU>> x=-1:10^-3:1; z=find(abs(x-0.936000000000000)<=eps('double') )

z =

1937


--Nasser



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

[Privacy Policy] [Terms of Use]

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