e6exam1secBsolnsW09

e6exam1secBsolnsW09 - Engineering 6, Winter 2009 Midterm...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
___________________________________________________________________________ (v) x = linspace(2,4,5) x = 2.0000 2.5000 3.0000 3.5000 4.0000 Note: 0’s optional. ___________________________________________________________________________ (vi)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/23/2010 for the course ENG 6 taught by Professor Largerstrom during the Fall '08 term at UC Davis.

Page1 / 12

e6exam1secBsolnsW09 - Engineering 6, Winter 2009 Midterm...

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

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