ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure...

36
ENED 1090 Midterm Exam Review 1

Transcript of ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure...

Page 1: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

1

ENED 1090 Midterm Exam Review

Page 2: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

2

Outline

• General Information– Time, place, etc– Exam Structure– Topics– Types of questions

• Review Questions

Page 3: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

3

General Information

• What: ENED 1090 Midterm Exam• Day: Thursday, October 24th, 2013• Time: 6:00-7:30pm OR 7:45-9:15pm• Where: Zimmer Auditorium

Page 4: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

4

General Information

• Exam Structure– Exam is out of 100 points– 7 questions, some questions with multiple parts– Short answer and worked out problems– “Cheat Sheet” provided with fprintf, input, menu

– Calculator allowed

Page 5: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

5

General Information

• Topics:– Number conversions: binary, decimal, hexadecimal– Plotting: how to create plots in MATLAB, problems

you might encounter and how to fix them– Mathematical operations– Interpolation and curve fitting– Input/output: input, menu, fprintf– Conditional Structures: Boolean/relational logic, if-

elseif-else, switch

Page 6: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

6

General Information

• You will NOT have to hand-write a program on the exam

• You will need to be able to:– Determine the output of a code fragment– Translate a mathematical statement into MATLAB– Modify existing code– Answer conceptual questions about the different

topics

Page 7: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

7

Review Questions

Page 8: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

8

Review Questions: Number Conversions

• How do you convert a number from decimal to binary?

• How do you convert a number from binary to decimal?

• How do you convert a number from binary to hexadecimal?

• How do you convert a number from hexadecimal to binary?

Page 9: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

9

Review Questions: Number Conversions

• Convert the following numbers to binary:227 2076

Page 10: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

10

Review Questions:Number Conversions

• Convert the following binary numbers to decimal numbers:110110

110010110001

Page 11: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

11

Review Questions:Number Conversions

• Convert the following binary numbers to hexadecimal1101010111000010

0101101001101001

Page 12: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

12

Review Questions:Number Conversions

• Convert the following hexadecimal numbers to binaryE6AD5

CABB46E

Page 13: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

13

Review Questions:Number Conversions

• Convert the following decimal number to hexadecimal8475

• Convert the following hexadecimal number to decimalB3A2CA75

Page 14: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

14

Review Questions:Plotting

• List the steps and MATLAB commands required to plot the mathematical expression shown below with appropriate labels and titles:

Page 15: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

15

Review Questions:Plotting

• What kinds of problems can you have when plotting?

• How can you fix them?

Page 16: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

16

Review Questions:Mathematical Operations

• How would you write the following equations in MATLAB?

• If you assume T = 0:25:325, how does that change the expression for in MATLAB?

Page 17: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

17

Review Questions: Interpolation

• What does interpolation mean?

• What is the purpose of performing interpolation?

Page 18: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

18

Review Questions: Interpolation

• What are the different methods of interpolation discussed in class?

• What are the benefits/drawbacks of each?

Page 19: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

19

Review Questions: Interpolation

• Assume you have the following two points:(3,4) (6,8)

Use linear interpolation to find the value at:

X = 4

X = 5.3

Page 20: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

20

Review Questions: Interpolation

• Using nearest point and linear interpolation, find the value of the point at the following times:

• t = 2.2s• t = 0.9s• t = 4.35s

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 51

2

3

4

5

6

7

8

9

10Sample Data

Time (s)

Am

plitu

de (

q)

Page 21: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

21

Review Questions: Interpolation

• Using nearest point and linear interpolation, find the value of the point at the following times:

• t = 1.1s• t = 2.8s• t = 3.85s

Time (s) Amplitude (q)0 1

0.5 11 9

1.5 72 4

2.5 103 1

3.5 54 4

Page 22: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

22

Review Questions: Curve Fitting

• What does curve fitting mean?

• What is the purpose of performing curve fitting?

Page 23: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

23

Review Questions: Curve Fitting

• How do you perform curve fitting in MATLAB?

• What is the difference between curve fitting and interpolation?

Page 24: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

24

Review Questions:Conditional Structures

• What are the three main Boolean logic operators and how do they operate?

Page 25: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

25

Review Questions:Conditional Structures

• What are the six main relational logic operators and how do they operate?

Page 26: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

26

Review Questions:Conditional Structures

• Assuming A = 3, B = 5, C = true, and D = false, what do the following expressions result in?– C && D– C || D– A && C– A > B– C < B || D– (A + C) < B && ~D || B < A

Page 27: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

27

Review Questions:Conditional Structures

• What will the output be of the following code fragment if:

user inputs: Canswer = input('Grade your prof (A,B,C,D,F): ','s');if answer == 'A' || answer == 'B' disp('You''re right!');elseif answer == 'C' disp('That could be better…');elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s');else disp('Um…try again?');end

Page 28: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

28

Review Questions:Conditional Structures

• What will the output be of the following code fragment if:

user inputs: Aanswer = input('Grade your prof (A,B,C,D,F): ','s');if answer == 'A' || answer == 'B' disp('You''re right!');elseif answer == 'C' disp('That could be better…');elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s');else disp('Um…try again?'); end

Page 29: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

29

Review Questions:Conditional Structures

• What will the output be of the following code fragment if:

user inputs: Fanswer = input('Grade your prof (A,B,C,D,F): ','s');if answer == 'A' || answer == 'B' disp('You''re right!');elseif answer == 'C' disp('That could be better…');elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s');else disp('Um…try again?'); end

Page 30: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

30

Review Questions:Conditional Structures

• What will the output be of the following code fragment if:

user inputs: banswer = input('Grade your prof (A,B,C,D,F): ','s');if answer == 'A' || answer == 'B' disp('You''re right!');elseif answer == 'C' disp('That could be better…');elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s');else disp('Um…try again?'); end

Page 31: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

31

Review Questions:Conditional Structures

• What will the output be of the following code fragment if:

user presses: Danswer = menu('What grade would you like?','A','B','C','D','F');switch answer case 5 fprintf('That''s not good\n'); case 4 fprintf('You selected %d, also not good\n',answer); case 3 fprintf('That''s better\n'); case 2 fprintf('Now we''re talking, you chose %0.2f\n',answer); otherwise fprintf('Shoot for the stars!\n');end

Page 32: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

32

Review Questions:Conditional Structures

• What will the output be of the following code fragment if:

user presses: Banswer = menu('What grade would you like?','A','B','C','D','F');switch answer case 5 fprintf('That''s not good\n'); case 4 fprintf('You selected %d, also not good\n',answer); case 3 fprintf('That''s better\n'); case 2 fprintf('Now we''re talking, you chose %0.2f\n',answer); otherwise fprintf('Shoot for the stars!\n');end

Page 33: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

33

Review Questions:Conditional Structures

• What will the output be of the following code fragment if:

user presses: Aanswer = menu('What grade would you like?','A','B','C','D','F');switch answer case 5 fprintf('That''s not good\n'); case 4 fprintf('You selected %d, also not good\n',answer); case 3 fprintf('That''s better\n'); case 2 fprintf('Now we''re talking, you chose %0.2f\n',answer); otherwise fprintf('Shoot for the stars!\n');end

Page 34: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

34

Review Questions:Problem Solving

• The figure below shows a mass spring model used to design packaging systems and vehicle suspensions. The springs exert a force that is proportional to their compression, and the proportionality constant is the spring constant k. The two side springs provide additional support if the weight is too heavy for the center spring. A weight will cause a total displacement of x, based on the following formula: W = Σ(ki*xi), where ki is the spring constant for a given spring and xi is the amount a given spring is compressed. For a given weight, determine the total displacement.

W

d1d2k1

k2 k3

x

Page 35: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

35

Review Questions:Problem Solving

• Describe the inputs, outputs, and processing required to solve this problem

• Create a representation (flowchart, pseudocode, other) of a MATLAB solution for this situation

• Write a MATLAB script to solve this problem

W

d1d2k1

k2 k3

x

Page 36: ENED 1090 Midterm Exam Review 1. Outline General Information – Time, place, etc – Exam Structure – Topics – Types of questions Review Questions 2.

36

Good luck studying!

Image taken from http://www.despair.com