class6b_matlab_activities_engr195%28II%29s10

class6b_matlab_activities_engr195%28II%29s10 - ENGR 195(II)...

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

View Full Document Right Arrow Icon
ENGR 195(II) – Spring 2010 Activity 1 Class 6b Activity 1 – Logical Operators Pair Exercise (Estimated Time = 20 minutes) Through this exercise, your team will practice reading logical expressions. A. I have some money to invest. I have several rules for my investment. Logical statements are given and you must decide if the statement provided is correct based on the statements. If it is incorrect, you should modify the statement so that it is correct. 1. A fund must invest in Ford. I will never invest in a fund that invests in either Dynegy or United. F | ~(D & U); % invest F & ~(D&U); % invest 2. I require a fund that invests in Verizon. A fund that invests in Verizon must also invest in Corning. A fund that invests in Verizon must not invest in Qwest. V & C | ~Q; % invest (V & C) & (~Q); % invest 3. The fund must invest in Elmer's. The fund has to invest in Headway or in Juniper, and it may invest in both. E & (H | J); % invest 4. If a fund invests in Oracle, it must invest in Realnetworks. If a fund invests in Realnetworks, it must invest in Xerious. I require that the fund invest in Xerious, and it can invest in Oracle. (O & R & X) | (R & X); % invest (O & R & X) | (R & X) | (X); % invest B. Given the following variable assignments, determine by hand the results of the original logical expressions written above (do not use your corrected statements). Non-zero values indicate an investment has been made. 1. F = 1; D = 0; U = 0 2. V = [1 0]; C = [1 1]; Q = [0 1] 3. E = [1 1 0]; H = [0 1 0]; J = [1 1 0] 4. O = [1 1 1]; R = [1 0 0]; X = [1 0 1] 1. 1 2. [1 0] 3. [1 1 0] 4. [1 0 0]
Background image of page 1

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

View Full DocumentRight Arrow Icon
ENGR 195(II) – Spring 2010 Activity 2 Class 6b Activity 2 – Error-Checking in a Function Pair Exercise (Estimated Time = 30 minutes) In Class 5a, you developed a function that had as arguments the lengths of two sides (a and b) of an
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

class6b_matlab_activities_engr195%28II%29s10 - ENGR 195(II)...

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

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