ENGR132_Class3A_Knutson

ENGR132_Class3A_Knutson - Welcome to ENGR132 Transforming...

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

View Full Document Right Arrow Icon
Click to edit Master subtitle style ENGR132 Transforming Ideas to Innovation II Section 006 & 021 Prof. Amanda Knutson and GTA Ben Ahn Class 3a Welcome to
Background image of page 1

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

View Full DocumentRight Arrow Icon
4/24/11 Announcement Exam 1: Monday Feb 14th 8:00 – 9:00 pm Elliot Hall No make up exams will be given (DON’T MISS IT!) Worth 15% of your final grade – no adjustments!! Conflicts/accommodations see Chell Nyquist 22
Background image of page 2
4/24/11 Use logical, relational and conditional operators Draw and interpret flow charts that include different kinds of decision-making structures Describe and solve 2 types of problems using conditional statements Identify a region within a graph Check the validity of inputs 33 Learning Objectives for Today (Text, pg 589 -598)
Background image of page 3

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

View Full DocumentRight Arrow Icon
4/24/11 Logic statements have 2 conditions True – represented as 1 in Matlab False – represented as 0 in Matlab AND (&) True if and only if all are true OR (|) True if any is true Exclusive OR (xor) True if and only if one is true NOT (~) 44 Logical Operators
Background image of page 4
4/24/11 A can be true or false B can be true or false AND command: A & B Truth Table A B A&B 1 1 1 1 0 0 0 1 0 0 0 0
Background image of page 5

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

View Full DocumentRight Arrow Icon
4/24/11 A can be true or false B can be true or false OR command: A | B Truth Table A B A|B 1 1 1 1 0 1 0 1 1 0 0 0
Background image of page 6
4/24/11 XOR = “exclusive or” A can be true or false B can be true or false XOR command: xor(A,B) Truth Table A B xor(A,B) 1 1 0 1 0 1 0 1 1 0 0 0
Background image of page 7

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

View Full DocumentRight Arrow Icon
4/24/11 NOT command reverses other results A can be true or false B can be true or false NOT command: ~(A | B) Truth Table A B A|B ~(A|B) 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 1
Background image of page 8
4/24/11 < Less than > Greater than <= Less than or equal to >= Greater than or equal to ~= Not Equal to == Equal to * * Not single = because single = is to assign 99 Relational Operators in Matlab
Background image of page 9

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

View Full DocumentRight Arrow Icon
4/24/11 Given: a = 2, b = 3, c = 5, d = 3 (a == b) 0 (b == d) 1 (a > b) 0 (a+b == c) 1 (b < c) 1 (b <= c) 1 1010 Example
Background image of page 10
4/24/11 Given: U = [ 1 3 –2 5 ], V = [ 1 2 –5 4 ], W = [ 1 3 –2 5 ] (U<3) [ 1 0 1 0 ] (U<=(2*V)) [ 1 1 0 1 ] (U==V) [ 1 0 0 0 ] (U>V) [ 0 1 1 1 ] 1111 Example
Background image of page 11

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

View Full DocumentRight Arrow Icon
4/24/11 Compound Statements 1212 Given: a = 2, b = 3, c = 5, d = 3 (a < b) & (b < c) 1 & 1 = 1 (a < b) | (c < d) 1 | 0 = 1 ((c == b+a) & (b*d > 9)) | ((~(b >= d)) | (b*d < a*c)) ( 1 & 0) | (~(1) | 1) = ( 0 | 1 ) = 1 (a <= c <= d) ( 2 <= 5 ) <= 3 ± 1 <= 3 1 Matlab evaluates one statement at a time, from left to right
Background image of page 12
4/24/11 1313 Application: Determine the phase based on composition and
Background image of page 13

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

View Full DocumentRight Arrow Icon
4/24/11 1414 Application: Determine the phase for high B composition and high
Background image of page 14
4/24/11 1515 Determine the phase for mid B composition and high temperature
Background image of page 15

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

View Full DocumentRight Arrow Icon
4/24/11 1616 Determine the phase for mid B composition and low temperature
Background image of page 16
4/24/11 Objective: Determine the phase based on composition and temperature Inputs: Composition (% B) and temperature
Background image of page 17

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

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

Page1 / 49

ENGR132_Class3A_Knutson - Welcome to ENGR132 Transforming...

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

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