Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
problem with the function find

Subject: problem with the function find

From: Jose

Date: 13 Sep, 2010 18:53:06

Message: 1 of 4

Hello everyone, I have the next problem with the find function:

a=(-0.4:0.1:0.4)

a =

   -0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000 0.3000 0.4000

>> find(a==0)

ans =

     5 perfect

but something wrong here:


find(a==0.1)

ans =

   Empty matrix: 1-by-0

Why?

Cheers

Subject: problem with the function find

From: Steven_Lord

Date: 13 Sep, 2010 18:54:17

Message: 2 of 4



"Jose " <jose.l.vega@gmail.com> wrote in message
news:i6lrui$8cl$1@fred.mathworks.com...
> Hello everyone, I have the next problem with the find function:
>
> a=(-0.4:0.1:0.4)
>
> a =
>
> -0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000
> 0.3000 0.4000
>
>>> find(a==0)

*snip*

See question 6.1 in the newsgroup FAQ.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: problem with the function find

From: Matt Fig

Date: 13 Sep, 2010 19:01:08

Message: 3 of 4

http://matlabwiki.mathworks.com/MATLAB_FAQ#Why_is_0.3-0.2-0.1_not_equal_to_zero_.28or_similar.29.3F

Subject: problem with the function find

From: Renee

Date: 31 May, 2011 21:48:04

Message: 4 of 4

"Matt Fig" wrote in message <i6lsdk$914$1@fred.mathworks.com>...
> http://matlabwiki.mathworks.com/MATLAB_FAQ#Why_is_0.3-0.2-0.1_not_equal_to_zero_.28or_similar.29.3F

Thank you! I had the same problem and that helped!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us