Lecture+02+Presentation (1)

Lecture+02+Presentation (1) - 14:440 127 Introduction to...

Info icon This preview shows pages 1–13. Sign up to view the full content.

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

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

View Full Document Right Arrow Icon
14:440:127 Announcements & Clarifications New Lecture Notes will be posted on Sakai prior to Tuesday ʼ s Lecture Lecture Presentation will be posted on Sakai after Wednesday ʼ s Lecture HW01 will be posted this Wednesday - DUE Wednesday, Sept. 22nd PROJ01 will be posted this Friday - DUE Monday, Sept. 27th Exam 1 will begin Sept. 30th Changes to syllabus - next Recitations regarding the current Lecture start on Thursday and run through Wednesdays - at least until Thanksgiving time 2
Image of page 2
14:440:127 Last Lecture Class Syllabus MatLab Environment Variables Basic Data Types Relational and Logical Operators Flow Control - Conditional Statement IF Lets quickly recap (recapitulate)! 3
Image of page 3

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

View Full Document Right Arrow Icon
14:440: 127 Syllabus CHANGE!! Exam 1 = 15% Exam 2 = 20% Exam 3 = 25% THIS IS ANOTHER BIG CHANGE! Slightly less in value. 4 More than 2 absence = 0% credit We will be collecting RANDOMLY SELECTED problems from ANY UN-ANNOUNCED RECITATION for grading and this grade will count towards Homework grade! HW Problem Sets (Pass/Fail) = 10% Recitation Attendance = 6% May not be computer based. Projects 1 & 2 = 10% (5% each) Projects 3 & 4 = 14% (7% each)
Image of page 4
14:440: 127 Variables Contain values Start with a letter, continue with letters/numbers/underscore Case Sensitive (x is different than X) File Names -- ALSO DON'T INCLUDE SPACES Semicolon / disp whos, clear, clc 5
Image of page 5

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

View Full Document Right Arrow Icon
14:440: 127 Basic Data Types (1) MatLab DOES NOT require you to declare variables or their types 6 Using C++ Using MatLab
Image of page 6
14:440: 127 Basic Data Types (2) MatLab is dynamically typed = ok to change the type of variable whenever Strongly typed = if one variable type is needed for some operation it will NOT work on a different type Primary data type is the array Some basic classes of arrays are: Numeric: Integers(Scalar) and Floating Point Character (contains strings): Alphanumeric text MUST be in single quotes!! Cell Enclosed within { } Vector, Matrices Structs 7
Image of page 7

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

View Full Document Right Arrow Icon
14:440: 127 Logical Operators Relational Operators allow us to make comparisons that are either TRUE ( 1 or nonzero number ) or FALSE ( 0 ) and we can combine these using: & and - ONLY true when both conditions are TRUE 8 >> a=5; b=2; >> a~=b >> a~=b | a==b ans = 1 >> ~(a~=b | a==b) ans = 0 ans = 1 >> a==b ans = 0 >> a~=b & a==b ans = 0 | or - TRUE when either of the two conditions are TRUE ~ not (key under Delete on your keyboard) - will negate the current value
Image of page 8
14:440:127 Relational Operators <, <=, >, >= are no different that what you know (i.e x=3; x>2) == equal to 9 NOT!! the same as = ~= not equal to
Image of page 9

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

View Full Document Right Arrow Icon
14:440:127 Now Old Stuff + New Stuff! 10
Image of page 10
14:440: 127 Built-In Functions (1) Syntax -> FunctionName (input1, input2, input3,…) sqrt (5) % square root of 5 nthroot (27,3) % cube(3) root of 27 sin (pi) % sine of pi radians cos (pi/2) % cosine of pi/2 asin (1) % arcsine of 1 asin (1) % arcsine of 1 sind (75) % sine of 75 degrees log (5) % natural logarithm (base e) of 5 log10 (5) % logarithm (base 10) of 5 exp (5) % e^5 11 Notice how you HAVE to use exp and not e !
Image of page 11

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

View Full Document Right Arrow Icon
14:440: 127
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern