ENGR 121 Lecture Notes - Lecture 8: Atan2, Matrix Multiplication, Nan

53 views6 pages

Document Summary

Input in a for loop: can be used to repeat the process of promping the user and reading input a speciied number of imes for i = 1:n. % do something with the value end: the values entered can be stored into a vector it is best to irst preallocate the vector to have the correct number of elements. Combining for loops and if statements: the acion of a for loop can include an if statement, the acion of an if statement can include a for loop. Used if an acion is required on an element only if a condiion is met. Use ctrl + c to break out of an ininite loop. Couning in a while loop: it can be useful to count how many imes the acion of the loop has been repeated, general form of a while loop that counts counter = 0; while condiion. % acion counter = counter + 1; end.

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