14-440-127 Lecture 6 Presentation

14-440-127 Lecture 6 Presentation - 14:440:127 Introduction...

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

View Full Document Right Arrow Icon
14:440:127 Introduction to Computers for Engineers Lecture 6 Lecturer: Blase E. Ur Recitation Instructor: Tianming Li Recitation Instructor: Ke Xu Recitation Instructor: Brian Viezbicke Recitation Instructor: Mingliang Wang PLEASE TAKE LECTURE 6 NOTES AS YOU ENTER THE ROOM
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 University SOE 14:440:127 Lecture 6 Reminders / Updates Exam 1- Grades ~early next week. Project 1- Grades early next week. PSET 1- Grades later this week. Exam 1- No curve, but we will adjust the median grades to be the same as the highest section’s. Exam 1- 20% of your grade Exam 2- 20% of your grade Exam 3- 30% of your grade If Exam 3>>Exam 1 for a particular student, we will weight that more
Background image of page 2
Rutgers University SOE 14:440:127 Lecture 6 Loops disp(1) disp(2) disp(3) disp(4) disp(5) disp(6) disp(7) disp(8) disp(9)
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 University SOE 14:440:127 Lecture 6 Loops Hit drum Hit drum Hit drum Hit drum Hit drum Hit drum Hit drum Hit drum Hit drum Hit drum
Background image of page 4
Rutgers University SOE 14:440:127 Lecture 6 For Loop for VARIABLE = VECTOR STATEMENTS end for i = 1 : 100 disp(i) end • First time through the loop, i=1 • Then, go back to the top; i=2 • … • The last time through the loop, i=100
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 University SOE 14:440:127 Lecture 6 For Loop for VARIABLE = VECTOR STATEMENTS end for x = 1:6 hit_drum( ); end
Background image of page 6
Rutgers University SOE 14:440:127 Lecture 6 Sum 1 to 100 with a for loop s = 0; for z = 1:100 s = s+z; end disp(z)
Background image of page 7

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

View Full DocumentRight Arrow Icon
Rutgers University SOE 14:440:127 Lecture 6 Find the max (and location) in a vector maxvalue = -inf; location = -1; for x = 1:length(V) if(V(x)>maxvalue) maxvalue = V(x); location = x; end end disp(maxvalue) disp(location)
Background image of page 8
Rutgers University SOE 14:440:127 Lecture 6 Plan of attack to find all locations of max Go through each element of the vector, starting at the beginning Keep a running tab of the maximum value we’ve seen When you find other locations equal to that max value, add that location to the end of a vector full of locations But, when you see a value that’s greater than our current max, save that new maximum, erase the old locations vector, and start a new one with that new location
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.

Page1 / 30

14-440-127 Lecture 6 Presentation - 14:440:127 Introduction...

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

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