How do I solve the following problem with rounding?

I run the following code:
clear all
x=-2:0.1:2;
find(x==0.9)
I get:
ans = Empty matrix: 1-by-0
How can I fix this problem? The version I use is R2013a.
Thanks! niko

1 个评论

Avoid the clear all, because this is more brute than useful.
This is one of the most frequently asked questions. I suggest to read the other ones also: http://matlab.wikia.com/wiki/FAQ

请先登录,再进行评论。

回答(2 个)

类别

帮助中心File Exchange 中查找有关 Data Types 的更多信息

编辑:

Jan
2014-10-21

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by