360 likes | 551 Views
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
E N D
Outline • General Information • Time, place, etc • Exam Structure • Topics • Types of questions • Review Questions
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
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
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
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
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?
Review Questions: Number Conversions • Convert the following numbers to binary: 227 2076
Review Questions:Number Conversions • Convert the following binary numbers to decimal numbers:110110110010110001
Review Questions:Number Conversions • Convert the following binary numbers to hexadecimal11010101110000100101101001101001
Review Questions:Number Conversions • Convert the following hexadecimal numbers to binaryE6AD5CABB46E
Review Questions:Number Conversions • Convert the following decimal number to hexadecimal8475 • Convert the following hexadecimal number to decimalB3A2CA75
Review Questions:Plotting • List the steps and MATLAB commands required to plot the mathematical expression shown below with appropriate labels and titles:
Review Questions:Plotting • What kinds of problems can you have when plotting? • How can you fix them?
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?
Review Questions: Interpolation • What does interpolation mean? • What is the purpose of performing interpolation?
Review Questions: Interpolation • What are the different methods of interpolation discussed in class? • What are the benefits/drawbacks of each?
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
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
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
Review Questions: Curve Fitting • What does curve fitting mean? • What is the purpose of performing curve fitting?
Review Questions: Curve Fitting • How do you perform curve fitting in MATLAB? • What is the difference between curve fitting and interpolation?
Review Questions:Conditional Structures • What are the three main Boolean logic operators and how do they operate?
Review Questions:Conditional Structures • What are the six main relational logic operators and how do they operate?
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
Review Questions:Conditional Structures • What will the output be of the following code fragment if: user inputs: C answer = input('Grade your prof (A,B,C,D,F): ','s'); ifanswer == 'A' ||answer == 'B' disp('You''reright!'); elseifanswer == 'C' disp('That could be better…'); elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s'); else disp('Um…try again?'); end
Review Questions:Conditional Structures • What will the output be of the following code fragment if: user inputs: A answer = input('Grade your prof (A,B,C,D,F): ','s'); ifanswer == 'A' ||answer == 'B' disp('You''reright!'); elseifanswer == 'C' disp('That could be better…'); elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s'); else disp('Um…try again?'); end
Review Questions:Conditional Structures • What will the output be of the following code fragment if: user inputs: F answer = input('Grade your prof (A,B,C,D,F): ','s'); ifanswer == 'A' ||answer == 'B' disp('You''reright!'); elseifanswer == 'C' disp('That could be better…'); elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s'); else disp('Um…try again?'); end
Review Questions:Conditional Structures • What will the output be of the following code fragment if: user inputs: b answer = input('Grade your prof (A,B,C,D,F): ','s'); ifanswer == 'A' ||answer == 'B' disp('You''reright!'); elseifanswer == 'C' disp('That could be better…'); elseif answer == 'D' || answer == 'F' disp('Uh oh, Spaghetti O''s'); else disp('Um…try again?'); end
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''snot good\n'); case 4 fprintf('You selected %d, also not good\n',answer); case 3 fprintf('That''sbetter\n'); case 2 fprintf('Now we''retalking, you chose %0.2f\n',answer); otherwise fprintf('Shoot for the stars!\n'); end
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
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
Review Questions:Problem Solving W x d1 d2 k1 k2 k3 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.
Review Questions:Problem Solving W x d1 d2 k1 k2 k3 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
Good luck studying! Image taken from http://www.despair.com