MAE 08 Lecture Notes - Lecture 10: Exclusive Or, Negation, Working Directory

61 views3 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents