lecture_04_Branching_2p - Lecture 4: branching statements...

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

View Full Document Right Arrow Icon
1 1. What are branching statements? 2. First type of branching statements: if 3 Second type of branching statement: if else Lecture 4: branching statements 3. Second type of branching statement: if else 4. Third type of branching statement: if elseif else 5. Refresher on logical operators What are branching statements? Branching statements are conditional clauses which execute instructions based on the value of some variables. Example: if [my grandmother is cool] [she will give me a candy] end This type of logic can be expressed easily with Matlab branching statements: if
Background image of page 1

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

View Full DocumentRight Arrow Icon
What are branching statements? Branching statements are conditional clauses which execute instructions based on the value of some variables. Example: Example of execution of the code Second type of branching statement Branching statements are conditional clauses which execute instructions based on the value of some variables. Example: if [my grandmother supercool] [she will give me candy and a toy] Else [she will only give me candy]
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

lecture_04_Branching_2p - Lecture 4: branching statements...

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

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