{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

e6exam1secBsolnsW09

# e6exam1secBsolnsW09 - Engineering 6 Winter 2009 Midterm...

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

Engineering 6, Winter 2009 Midterm Solutions Lecture Section B (MWF10-11) Regrade requests must be submitted in writing to Dr. Lagerstrom no later than the lecture section on Friday, Feb. 27. Regrades will only be considered in cases where it looks like the grader missed something. That is, requests along the lines of "I think I deserve more points" will not get very far, because the the grading scale on each problem was applied consistently for all students. Note also : Your exam may have been photocopied before it was returned, so please don't risk your engineering career here at UCD by changing an answer and submitting it for a regrade. Exam Version A (blue and tan copies) Problem 1. (16 points total) (a) (8 points) Briefly describe the significance of each of the following Matlab variables: (i) ans Generic variable name that is used when displaying a result, if a variable name wasn’t specified (ii) inf infinity (iii) nan not a number (i.e., a result of an operation that cannot be done, e.g., 0 divided by 0) (iv) eps the smallest difference (or gap) between two floating point numbers in the vicinity of 1 in Matlab (or the IEEE double precision scheme) (b) (8 points) Draw sketches of the onion diagram and the von Neumann diagram and label the key parts. Hardware Application Software Operating System Software CPU Input Output Secondary Storage Memory

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

View Full Document
Problem 2. (30 points total) (a) (6 points) Convert the following equation to a Matlab assignment statement (i.e., write it in Matlab notation). Use built-in functions where possible. Assume all variables are scalars. x y b D ln 23 ) 31 . 0 arctan( 2 + = Answer: D = atan(0.31)/(23*sqrt((b+y^2)/log(x))) Note: it must be atan(0.31), not atan2(0.31). The parentheses as shown are required. (b) (24 points) Give the Matlab result (what it would display) for the following sequences of commands. Grading note: Okay to just display the number results, not the “z =” etc. (except for iii) Results (i) x = [7 3 4 9]; y = [2 3 5 6]; z = x*y Results in error message (either “inner matrix dimensions must agree” or “matrix must be square”; full credit if simply say that an error message will result) ___________________________________________________________________________ (ii) x = [7 3; 4 9]; y = [2 3; 5 6]; z = x.*y z = 14 9 20 54 ___________________________________________________________________________ (iii) x = 14.9397; fprintf('The value of x is %.1f\n',x); fprintf('Or it may also be written as %.3e',x); The value of x is 14.9 Or it may also be written as 1.494e+001 ___________________________________________________________________________ (iv) x = [7 4 3 9 2 9 8 10 5 12]; y = x([4 3 9]) y = 9 3 5
___________________________________________________________________________ (v) x = linspace(2,4,5) x = 2.0000 2.5000 3.0000 3.5000 4.0000 Note: 0’s optional. ___________________________________________________________________________ (vi) A = [5 8 4; 3 9 6; 7 3 9]; C = A(3,:) C = 7 3 9 ___________________________________________________________________________ (vii) n = [1 –5 6]; z = roots(n) z = Note: Okay to write this as a row vector, or simply 3 as the two values. 2 ___________________________________________________________________________ (viii) k = [5 6]; m = [2 3]; z = polyder(k,m) z = 20 27

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

View Full Document
Problem 3. (24 points total) (a) (8 points) Write the Matlab commands that would determine and display the angular frequency ω , the frequency f , the period T , and the phasor X of the sinusoidal signal x(t) = 4cos(32t + π /7). w = 32 f = w/(2*pi) Note: f = w/2*pi is incorrect.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}