Show older comments
I am reviewing for a test and one of the questions is "what would be the outcome of 10>6>4?" I thought it would be logical: 1 because all the statements are true, but when I put it into MATLAB it returned logical: 0 for any number I used. Can anyone explain this?
Accepted Answer
More Answers (1)
Steven Lord
on 17 Sep 2018
Type the following into the MATLAB Editor:
y = 10>6>4;
The number 6 is underlined in orange. Hover over the number 6 to see what the Code Analyzer message says. The details explain how MATLAB interprets that statement and what you should use instead.
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!