Can we compare logical to numeric type (double) in MATLAB? Why 0 <= 0.1 <= 0.2 returns 0 and 0 <= 2 <= 4 returns 1?
Can we compare logical to numeric type (double) in MATLAB? Why 0 <= 0.1 <= 0.2 returns 0 and 0 <= 2 <= 4 returns 1?
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: