ened 1090 midterm exam review
DESCRIPTION
ENED 1090 Midterm Exam Review. Outline. General Information Time, place, etc Exam Structure Topics Types of questions Review Questions. General Information. What: ENED 1090 Midterm Exam Day: Thursday, October 24 th , 2013 Time: 6:00-7:30pm OR 7:45-9:15pm - PowerPoint PPT PresentationTRANSCRIPT
1
ENED 1090 Midterm Exam Review
2
Outline
• General Information– Time, place, etc– Exam Structure– Topics– Types of questions
• Review Questions
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
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
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
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
7
Review Questions
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?
9
Review Questions: Number Conversions
• Convert the following numbers to binary:227 2076
10
Review Questions:Number Conversions
• Convert the following binary numbers to decimal numbers:110110
110010110001
11
Review Questions:Number Conversions
• Convert the following binary numbers to hexadecimal1101010111000010
0101101001101001
12
Review Questions:Number Conversions
• Convert the following hexadecimal numbers to binaryE6AD5
CABB46E
13
Review Questions:Number Conversions
• Convert the following decimal number to hexadecimal8475
• Convert the following hexadecimal number to decimalB3A2CA75
14
Review Questions:Plotting
• List the steps and MATLAB commands required to plot the mathematical expression shown below with appropriate labels and titles:
15
Review Questions:Plotting
• What kinds of problems can you have when plotting?
• How can you fix them?
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?
17
Review Questions: Interpolation
• What does interpolation mean?
• What is the purpose of performing interpolation?
18
Review Questions: Interpolation
• What are the different methods of interpolation discussed in class?
• What are the benefits/drawbacks of each?
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
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
)
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
22
Review Questions: Curve Fitting
• What does curve fitting mean?
• What is the purpose of performing curve fitting?
23
Review Questions: Curve Fitting
• How do you perform curve fitting in MATLAB?
• What is the difference between curve fitting and interpolation?
24
Review Questions:Conditional Structures
• What are the three main Boolean logic operators and how do they operate?
25
Review Questions:Conditional Structures
• What are the six main relational logic operators and how do they operate?
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
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
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
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
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
31
Review Questions:Conditional Structures
• What will the output be of the following code fragment if:user presses: D
answer = 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
32
Review Questions:Conditional Structures
• What will the output be of the following code fragment if:user presses: B
answer = 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
33
Review Questions:Conditional Structures
• What will the output be of the following code fragment if:user presses: A
answer = 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
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
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
36
Good luck studying!
Image taken from http://www.despair.com