Matlab thinks 1.0000... is not 1

*Hello,
when typing the following code into the command window of Matlab the result of the last comparison is not (as expected) 0, but 1. Can anyone figure out whats going on there? And what can i do against? Using round, floor or something else is NOT an option in my use-case!*
>> Ebene=[0.2,0,0.2,0.3,0.2,0.1]
Ebene =
0.2000 0 0.2000 0.3000 0.2000 0.1000
>> sum(Ebene)
ans =
1.0000
>> ans<1
ans =
1

More Answers (0)

Community Treasure Hunt

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

Start Hunting!