MAE 08 Lecture Notes - Lecture 10: Exclusive Or, Negation, Working Directory
Document Summary
A function definition should be saved as a separate file as functionname. m and stored in working directory. Write a function my_max which takes three number inputs and return the maximum value. Write a function my_plot which takes two vector inputs x, y, and plots x versus y with customized figure details. Relational expressions give conceptually either true or false result. In matlab, a logical 0 is equivalent to false, a logical of any non-zero value is equivalent to true. Relational expressions can involve relational operators (, >=, <=, ==, ~=) and logical operators (&, |, &&, ||, xor, ~) if condition action; end. A condition is an expression that it logically true or false. An action is the statement which is executed if the condition is true. A condition can be simple: x>3 or can be complex: student == y" | | student == y". Multiple degrees of freedom: x >= 3 && y <= 9.