ENME 202 Lecture Notes - Lecture 3: Complex Analysis, Matlab, Row And Column Vectors

36 views3 pages

Document Summary

Complex numbers a = 2; b = 4; c = 10; x1 = (-b+sqrt(b^2-4*a*c)/(2*a) x2 = (-b-sqrt(b^2-4*a*c)/(2*a) Don"t need * when multiplying by i a = 2; b = 4; c = 10; x1 = (-b+sqrt(b^2-4*a*c)/(2*a) x2 = (-b-sqrt(b^2-4*a*c)/(2*a) a = 5; x1 = -1. 0000 + 2. 0000i x1 = (-b+sqrt(b^2-4*a*c)/(2*a) %you"ve reassigned a but not x1 - have to run again. The above is needed when you are in a command window. % report current values of a, b, and c a, b, c x1 = (-b+sqrt(b^2-4*a*c)/(2*a) x2 = (-b-sqrt(b^2-4*a*c)/(2*a) Now if you change the values of a, b, or c and run the script, the values of x1 and x2 will update. If you clear and then run the script, there are no assigned values of a, b, c so error. Comment the code (needed for grade) unless it"s very obvious. Use intermediate variables a=2; b=4; c=10; disc = b^2 - 4*a*c ; %disc = discriminate.

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