Unformatted text preview: Problem: solve for s: s 2 + 5 s + 6 = 0 s = − b ± √ b 2 − 4 ac 2 a Matlab session: >> diary roots >> a=1; >> b=5; >> c=6; >> x = b/(2*a); >> y = sqrt(b^24*a*c)/(2*a); >> s1 = x+y s1 =2 >> s2 = xy s2 =3 The Fle roots is written in your current working directory. It can be displayed by the Matlab command type roots . It can also be displayed in a Unix terminal window by the command more roots or printed with the command lp roots . a=1; b=5; 40...
View
Full Document
 Summer '09
 CHANG
 English, matlab, Quadratic equation, Elementary algebra

Click to edit the document details