Search All of the Math Forum:

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

Topic: Problem with the find function
Replies: 2   Last Post: May 20, 2012 4:12 PM

 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

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

Date Subject Author
5/20/12 Neriya Cohen
5/20/12 Nasser Abbasi
5/20/12 Derek Goring