{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture_E7_06_6p

lecture_E7_06_6p - 1 • Boolean variables tests – Yes no...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 • Boolean variables, tests – Yes no answers, tests – Logical operators – Application of logical operators to arrays • Conditional statements Lecture 6: conditional statements – if / then / else clauses Reference: book, Chapter 4 Additional material: Lecture_06.m (available on bSpace) Yes/no answers, tests In matlab, the following statements are equivalent: “YES” or “true” or 1 “NO” or “false” or 0 In other words the way for matlab to encode a positive answer is to use a boolean variable equal to 1. The way to encode a negative answer is to use a boolean variable equal to 0. Boolean means equal to 0 or 1 A test is a question to which the answer is yes or no. The result is encoded by matlab as a boolean variable. For example if the test is “Is the age of the E7 instructor less than 100 years” The answer should be: 1 Tests Assignment (the variable a is assigned to 11) Tests Assignment (the variable a is assigned to 11) Test. different from an assignment: it Test....
View Full Document

{[ snackBarMessage ]}

Page1 / 3

lecture_E7_06_6p - 1 • Boolean variables tests – Yes no...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online