Reputation: 31
Can we compare logical to numeric type (double) in MATLAB? Why 0 <= 0.1 <= 0.2 returns 0 and 0 <= 2 <= 4 returns 1?
Upvotes: 2
Views: 78
Reputation: 568
You should not read 0 <= 0.1 <= 0.2 and 0 <= 2 <= 4 in a mathematical way but in a programming way.
Considering a cast like true<-->1
and false<-->0
,
I mean:
similarly:
Upvotes: 4