Module 4 of 8

Logical Statements

4 lessons  ·  Relational operators, logical operators, logical indexing

1

Overview of relational operators

Topics covered

  • Relational operators: <, >, <=, >=, ==, ~= and their logical outputs
  • For complex numbers, only the real part is used for >, <, >=, <= — both parts are used for ~= and ==
  • Examples with scalars, vectors and arrays
3

Logical operators extended and logical statements

Topics covered

  • find(), any() and all()
  • Combining relational and logical operators
  • Creating complex logical statements, e.g. checking if x < y < z for any value of y
  • Examples using matrices