This preview shows page 1. Sign up to view the full content.
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^2-4*a*c)/(2*a); >> s1 = x+y s1 =-2 >> s2 = x-y 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
This note was uploaded on 03/07/2010 for the course ENG 101 taught by Professor Chang during the Summer '09 term at 東京国際大学.
- Summer '09