Others have commented on the fact that you need to call your function with an input argument. I want to point out a different problem that you have. One of your lines of code is unreachable. When you have code that looks like:
exactly one of doA, doB, doC, and doD will execute. Even if something that satisfies condition 3 also satisfies condition 1, doA and doC will not both execute. If anything that satisfies condition 3 also satisfies condition 1 but not the reverse, you should check for condition 3 first.
disp('x is less than 10')
disp('x is greater than or equal to 10')
Try defining x to have various values between say 1 and 20 and run that example then do the same for the following example:
disp('x is less than 10')
disp('x is greater than or equal to 10')
0 Comments
Sign in to comment.