Lecture+06+Presentation

Lecture+06+Presentation - 14:440:127 Introduction to...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
14:440:127 Introduction to Computers for Engineers Lecture 6 Lecturer: Brenda Cortez Recitation Instructors: Yun, Bo, Karthik, Muhammad 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Rutgers School of Engineering LEC06 14:440:127 General Announcements HW02 - DUE THIS WEDNESDAY - expected output = what you must have PROJ02 - WILL BE ASSIGNED ON FRIDAY EXAM01 - GRADES OUT BY WEDNESDAY - exams @ my of±ce to view only OfFce Location changed to BME120 - no of±ce hours on Tuesdays apps.rutgers.edu - try it out again and answer bi-weekly polls on Sakai Attending the University of Illinois ACM (Association for Computing Machinery) Re²ections|Projections Conference 2010 Conference Videos @ http://www.acm.uiuc.edu/conference/2010/ Learn more about ACM @ http://www.acm.org/ Will not be in of±ce on Friday, October 15 2
Background image of page 2
Rutgers School of Engineering LEC06 14:440:127 Last week ʼ s topics: Plotting 2D, 3D, Meshgrid, Log plots Graphical Input Interpolation Regression Fitting Equation to Data 3 Lets do some examples. ..take notes!
Background image of page 3

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

View Full DocumentRight Arrow Icon
Rutgers School of Engineering LEC06 14:440:127 Using a polynomial to model a function can be very useful, but it is always dangerous to extrapolate beyond your data. We can demonstrate this pitfall by modeling a sin wave as a third order polynomial. a)DeFne x from -1 to 1 in increments of 0.1 b)Calculate y as being the sin of the elements in x c)Use the polyFt function to determine the coefFcients of a third order polynomial to model the set of data. d)Use the polyval function to calculate new values of y (modeled_y), based on your polynomial, for your x vector from -1 to 1 e)Plot both sets of values on the same graph. How good is the Ft? f)Create a new_x vector from -4 to 4 in increments of 0.1 g)Create a new_y values by Fnding sin(new_x) h)Extrapolate new_modeled_y values by using polyFt, the coefFcients vector you found in part(c) to model x and y between -1 and 1, and the new_y values i)Plot both new sets of values on the same graph. How good is the Ft outside of the region from -1 to 1? 4
Background image of page 4
Rutgers School of Engineering LEC06 14:440:127 Loops FOR and WHILE loops Iterative – Over and Over again Each pass through a loop is called an iteration 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
Rutgers School of Engineering LEC06 14:440:127 Prior to For Loops DISPLAY HELLO 15 TIMES THE OLD FASHION WAY disp('HELLO') disp('HELLO') disp('HELLO') disp('HELLO') disp('HELLO') ... disp('HELLO') 6 sooooooo repetitive! solve it with a loop!
Background image of page 6
Rutgers School of Engineering LEC06 14:440:127 For Loops for VARIABLE_NAME = VECTOR_OF_VALUES STATEMENTS .... end 7 Note: It says VECTOR ! vector of values 1->15 variable name is x Example: for x = 1:15 disp('HELLO') end
Background image of page 7

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

View Full DocumentRight Arrow Icon
LEC06 14:440:127 Prior to For Loops In the old fashion way , for 1 through 15, print: The number is… fprintf('The number is %.0f\n',1) fprintf('The number is %.0f\n',2) fprintf('The number is %.0f\n',3) fprintf('The number is %.0f\n',3) ... ... ... fprintf('The number is %.0f\n',15)
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 03/14/2011.

Page1 / 43

Lecture+06+Presentation - 14:440:127 Introduction to...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online