Skip to main content

more options

Part 4: Scripts, plots, I/O      Part 6: Loops

Module 1, part 5. Conditionals.


No. Topic Description
1. Conditional statement   Blecture This blecture describes the if - else statement, the elseif keyword, and short-circuiting (with logical operators).
2. Examples   quadMin.m   quadMin2.m These two scripts demonstrate the conditional statement using the same problem. One script uses nested ifs; the other uses elseif.
3. Self-check exercise Practice writing code fragments that use if - elseif - else - end constructions.