====== Differences ====== This shows you the differences between two versions of the page.
gibson:teaching:spring-2015:math445:examplelab [2015/01/19 12:33] gibson created |
gibson:teaching:spring-2015:math445:examplelab [2015/01/19 12:35] (current) gibson |
||
---|---|---|---|
Line 33: | Line 33: | ||
ans = 7.38905609893065 | ans = 7.38905609893065 | ||
- | >> % Problem 2: Evaluate 0 < 2 < 2 in Matlab and explain the result. | + | >> % Problem 2: Evaluate 0 < 5 < 2 in Matlab and explain the result. |
- | >> 1 < 2 < 2 | + | >> 0 < 5 < 2 |
ans = | ans = | ||
1 | 1 | ||
- | >> % For the expression 0 < 2 < 2, Matlab returns 1 because... | + | >> % For the expression 0 < 5 < 2, Matlab returns 1 because... |
- | >> % the first comparison 0 < 2 is a logical expression that evaluates to 1 (true) | + | >> % the first comparison 0 < 5 is a logical expression that evaluates to 1 (true) |
- | >> % replacing 0 < 2 with 1 leaves 1 < 2, another logical expression that evaluates to 1 (true) | + | >> % so 0 < 5 < 2 reduces to 1 < 2, another logical expression that evaluates to 1 (true) |
</code> | </code> |