# Lec2 - 1 Basics Variables and Expressions Assignment...

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

1. Basics Variables and Expressions Assignment Statements Built-In Functions Scripts Comments Keyboard Input Formatting Output

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

View Full Document
Approach Preview key concepts by first playing with Matlab as a calculator. From formula to program.
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 π =

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

View Full Document
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
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

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

View Full Document
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