{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

FinalExamS2009Pt2FinalVersionSolution

# FinalExamS2009Pt2FinalVersionSolution - UNIVERSITY AT...

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

1 UNIVERSITY AT BUFFALO EAS 230 Final Examination Part II May 6, 2009 Each of the 20 questions on Part II is worth 5 points. NAME ______________________________ SECTION#_______ UBIT ID (email):__________ Q1 to Q5 Predict the complete output of the following MatLab code segments. Circle the correct answer. Each segment is independent from the others . Q1) a=3*[8 2]/2; fprintf ('%5.0f %5.0f\n',a); ---------------------------------------------------------------- Q2) c=[2 4]; d=[4;3]; e=c*d; fprintf('%4.1f \n',e); ---------------------------------------------------------------- Q3) a=[2 3]; b=a.^2; c=a.*b; fprintf('%6.1f\n',c); ---------------------------------------------------------------- Q4) a=[3 2; 2 1]; b=[4; 2]; c=inv(a)*b; fprintf('%5.2f \n',c) %hint, use basic algebra. ---------------------------------------------------------------- Q5) y=[1:5:13]; z=y.*y; fprintf('%6.0f \n ',z); ---------------------------------------------------------------- 24 1 24 1 12 3 12 3 40.0 20.0 8.0 16.0 6.0 12.0 8.0 6.0 16.0 12.0 216.0 4.0 9.0 8.0 27.0 16.0 81.0 2.00 2.00 1.00 2.00 2.00 0.00 0.00 2.00 1 25 169 1 36 121 1 5 11 1 5 13

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

View Full Document