che310mtexam

# che310mtexam - Ch E 310 Name SOLUTIONS Instructions Spring...

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

Ch E 310 Spring 2008 Midterm Exam 1 Name: SOLUTIONS Instructions: The exam is open book and open notes You may use your calculator Show all of your work in a neat and concise manner If you need more room to work, use the back of the page or attach scratch paper 1. (25 points) Evaluate the following command line entries (i.e., what will MATLAB return as output?). If MATLAB will give an error, say so and explain why. Wherever possible, please show how you arrived at your answer sufficiently to prove you understand the procedure. a. (2 points) >> 5*ones(3)-[3 4 5; 3 4 5; 2 5 3]' = - = - × 2 0 0 0 1 1 3 2 2 3 5 5 5 4 4 2 3 3 5 5 5 5 5 5 5 5 5 3 5 5 5 4 4 2 3 3 1 1 1 1 1 1 1 1 1 5 b. (3 points) >> x=[5 3 5]; y=[3 5 2]'; y*x ( 29 = × 10 6 10 25 15 25 15 9 15 5 3 5 2 5 3 (note: y*x x*y ) c. (5 points) >> A=[3 4 5; 8 7 5; 3 7 3]; det(A) det ( 29 ( 29 ( 29 3 7 7 8 5 3 5 3 8 4 7 5 3 7 3 3 7 3 5 7 8 5 4 3 × - × + × - × - × - × = = -42 - 36 + 175 = 97 d. (2 points) >> sqrt(3+3*5-3^3/3+9*3) 6 36 27 3 27 15 3 = = + - +

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

View Full Document
Ch E 310 Spring 2008 Midterm Exam 2 e. (3 points) >> B=[3 9 2; 3 1 3; 5 3 4]; B([1 3],[1:2])^2 = × = 54 30 54 54 3 5 9 3 3 5 9 3 3 5 9 3 4 3 5 3 1 3 2 9 3 B f. (4 points) >> sum=0; i=1; while 1/i > .15;... sum=sum + 1/i; a(i)=sum; i=i+1; end; a' = 4500 . 2 2833 . 2 0833 . 2 8333 . 1 5000 . 1 0000 . 1 a g. (3 points) >> (2*ones(2,3))*(4*ones(3,1)) == [24 12]' = == =
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern