e6exam1secAsolnsW09

# e6exam1secAsolnsW09 - Engineering 6 Winter 2009 Midterm...

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

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

View Full Document
Problem 2. (24 points total) (a) Convert the following to Matlab assignment statements. Use built-in functions where possible. Assume all variables are scalars. (3 points per part.) (i) fg x d c bx ax y + + + = 3 2 / y = (a*x^2 + b*x + c)/(d/x^3 + f*g) (ii) 3 1 - = wz k T L L = T*(1 – k/(w*z))^3 Note: the parentheses around the (w*z) are required. (iii) ) (log ) 2 (sin 10 2 w R t h = h = (sin(2*t))^2*R*log10(w) (b) Give the Matlab response (what it would display) to the following sequences of commands. (3 points per part.) Grading note: okay just to display the number results, not the “y =”, etc. Results (i) x = [7 4 9 2 9 8 10 5 12]; y = x(4) z = [4 y] y = 2 z = 4 2 ___________________________________________________________________________ (ii) y = [8+2j 2-3j]; L = length(y) y' L = 2 ans = Note: “i” may be written as “j”, and the 0’s 8.0000 - 2.0000i are optional. 2.0000 + 3.0000i ___________________________________________________________________________ (iii) x = [7 4 9 2 9 8 10 5 12]; x(2:3:9) ans = 4 9 5
(iv) x = logspace(3,7,5) x = 1000 10000 100000 1000000 10000000 Note: exponential notation okay too, i.e., 1.0e+003, 1.0e+004, . .., 1.0e+007 ____________________________________________________________________________ (v) A = [5 8; 4 3; 9 6]; C = A(:,2) C = Note: this must be written in column form. 8

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

View Full Document
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

e6exam1secAsolnsW09 - Engineering 6 Winter 2009 Midterm...

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

View Full Document
Ask a homework question - tutors are online