ENG 6 Lecture Notes - Lecture 6: While Loop, Matlab, Arithmetic Progression

89 views5 pages

Document Summary

Programming concept: code block: collection of matlab instructions identified if. You wish to execute them only under certain circumstances. You wish to repeat them a certain number of times: use other key words to identify code blocks, use indentations to identify code blocks/make them readable. Key command words: if, switch, while, for, case, otherwise, else, elseif, identified with blue coloring, not actually part of the code block, just instructions on what to do with code block. Requires two things: logical expression, code block. If expression is true, code block is executed. Otherwise, execution is resumed at instruction following code block. If-elseif: compound conditionals: by introducing elseif and else, allow for more tests if test returns false. General template for if-elseif statements: if

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