Lec2 - 1 Basics Variables and Expressions Assignment...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
1. Basics Variables and Expressions Assignment Statements Built-In Functions Scripts Comments Keyboard Input Formatting Output
Image of page 1

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

View Full Document Right Arrow Icon
Approach Preview key concepts by first playing with Matlab as a calculator. From formula to program.
Image of page 2
Three Formulas 2 ) cos( 1 ) 2 / cos( x x + = Surface Area of a Sphere Half-Angle Quadratic Equation a ac b b r 2 4 2 + ± = 2 4 r A π =
Image of page 3

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

View Full Document Right Arrow Icon
Surface Area Increase >> r = 6365; >> delta = .000001; >> A_plus = 4*pi*(r+delta)^2; >> A = 4*pi*r^2; >> Increase = A_plus - A Increase = 0.15996992588043
Image of page 4
Cosine(15 degrees) >> c = cos(pi/3); >> c = sqrt((1+c)/2); >> c = sqrt((1+c)/2) c = 0.96592582628907 >> c15 = cos(pi/12) c15 = 0.96592582628907
Image of page 5

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

View Full Document Right Arrow Icon
X 2 + 5x + 6 = (x+2)(x+3) >> a = 1; >> b = 5; >> c = 6; >> d = sqrt(b^2 - 4*a*c); >> r1 = (-b - d)/(2*a) r1 = -3 >> r2 = (-b + d)/(2*a) r2 = -2
Image of page 6