Look carefully at what you wrote! In the first conditional line, you check if x is greater than zero twice. In the second and third conditional line you use capital x and capital y. MATLAB is case sensitive. X is not the same as x, and Y is not the same as y.
Finally, you are to only use a single quote in MATLAB strings...
disp('A correct MATLAB string...')
Fix these things and you will be fine.
.
.
.
.
EDIT
You are still using some strange thing instead of a single quote. Look at this one:
>> x=-0.5, y=-2
if x<3 && y<3 && x>0 && y>0
disp ('x and y are less than 3 but greater than 0')
elseif x<0 && y<0
disp ('x and y are negative')
elseif x>3 || y>3
disp ('Either x or y is greater than 3')
else
disp ('None of the three conditions have been met')
end
x =
-0.5000
y =
-2
x and y are negative
Best Answer