There are a couple mistakes in your code. One is syntactical. When you write
that is not checking the two conditions x>0 and x>=90. Rather, it is checking the first condition, and simply displaying whether the second condition is true. That's why you get
as part of your output. Instead, you need to write
to check both conditions.
The second mistake is conceptual. Suppose the score is 93. You will meet the condition x>=90, so you will display "A". But then the code will continue along, and you will also meet the condition x>=80, so you will also display "B". (You have not told MATLAB to stop, or otherwise limited that case.)
Since this is presumably homework, I'll let you figure out a way to fix that.
Best Answer