{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ENGR 132 - QUIZ5

# ENGR 132 - QUIZ5 - Thurs/Tues 9:30-11:30 Quiz 5 1 What is...

This preview shows pages 1–6. Sign up to view the full content.

Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30

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

View Full Document
4/24/11 Quiz 5 1) Evaluate the following conditional statements given, a = 1 b = 5 c = 1 a) xor(a~=b, a==c) b) (a==1) & (c>=b) c) (a>b)|(~((a+c)==(b-3)))|(b>= 22
4/24/11 Solution >> a=1; >> b=5; >> c=1; >> answer1 = xor(a~=b, a==c) answer1 = 0 >> answer2 = (a==1) & (c>=b) answer2 = 0 +2 xor(1&1)=0 +2 (1&0)=0 +4 (0|~(1)|0)=0 +2 (1<=2)=1

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

View Full Document
Click to edit Master subtitle style 4/24/11 ENGR 132 Thurs/Tues 9:30-11:30

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Thurs/Tues 9:30-11:30 4/24/11 Quiz 5 1. What is output to the command window if the following script file is run in Matlab? List the variables that exist in the workspace. 2. If U = [1 -2 3 -4], V = [1 3 0 -2], give the 55 x=5; temp=55; if temp > 60 x=1 elseif temp < 40 x=3 else x=2 end 4/24/11 Solution 1. x=2 two variables exist in the workspace temp x 2. a) [1 0 1 0] + 4 + 1 + 1 +2 +2...
View Full Document

{[ snackBarMessage ]}