I have noticed a very strange issue using R2012a installed on Windows 7.
I was creating a very simple array a = [0.2:.1:1.2]'
I then searched for the index where a == 0.6 and kept getting no hit.
Confused, I looked at 'a' in the command window (in format long e) and was shocked to see:
a =
2.000000000000000e-01
3.000000000000000e-01
4.000000000000000e-01
5.000000000000000e-01
6.000000000000001e-01
7.000000000000000e-01
7.999999999999999e-01
8.999999999999999e-01
1.000000000000000e+00
1.100000000000000e+00
1.200000000000000e+00
0.6 , 0.8 and 0.9 are all off by the final machine error digit.
ANy idea what is causing this? Is this a known bug?
Update: To throw more fuel on the fire doing a = [2:1:12]./10 seems to work just fine.

カテゴリ

ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索

質問済み:

Cal
2013 年 11 月 20 日

回答済み:

dpb
2013 年 11 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by