110 likes | 279 Views
EGR 106 Intro to Engineering II. Engineering problem solving using MATLAB Text: Amos Gilat, MATLAB An Introduction with Applications , Wiley 2004 ISBN 0-471-43997-5. Instructor Section 1. James C Daly, Dept of Electrical; and Computer Engineering, 120 Kelley Annex
E N D
EGR 106 Intro to Engineering II • Engineering problem solving using MATLAB • Text: Amos Gilat, MATLAB An Introduction with Applications, Wiley 2004 ISBN 0-471-43997-5
Instructor Section 1 • James C Daly, Dept of Electrical; and Computer Engineering, • 120 Kelley Annex • Office hours MTWR 11 -12pm • daly@egr.uri.edu • 874-5844 (Office) 789-0654(Home) 742-5759(Cell)
Grading • Attendance 15% • Homework 15% • 3 Quizzes 45% • Team project 25%
Homework • 15% of your grade • No partial credit • Done during lab. • If you can not solve a problem, get help. • 10 point scale for each assignment • Late home work penalty is 2 points • Not accepted after one week.
MATLAB • MATrix LABoratory • Powerful • Easy to use • Expandable • Great graphics • Get your free (almost) copy of MATLAB for your PC from the wizards at ECL (Kirk203)
Arithmetic Operations • Addition + 2+2 • Subtraction - 3-2 • Multiplication * 3*6 • Right Division / 7/3 • Left Division \ 7\3 = 3/7 • Exponentiation ^ 2^3 = 8
Precedence • Precedence is the order operations are preformed • (3^2) anything in parentheses is done first • 5^2 exponentiation is next • 2*2 or 10/5 multiplication or division next • 1+1 or 5-3 addition or subtraction next • Operations are done from left to right
Precedence Example • 2^(6/2) = 2^3 = 8 • 2^6/2 = 64/2 = 32
Assignment operator = > x= 1; > x = 2*x+1; The value of x is 3 not -1 ; Some Syntax
Predefined Variables • ans • pi p • eps 2^(-52) about 2.22e-16 • inf 1/0 • i sqrt(-1) • j Same as i • NaN Not a number 0/0
Some Functions • Elementary Math, sqrt(x), exp(x), etc. • Trig, sin(x), cos(x), x is in radians • Rounding functions , round(x), etc