CS1371_Fall_2008_Practice_Test_Soln

CS1371_Fall_2008_Practice_Test_Soln - Outputs: diag...

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

View Full Document Right Arrow Icon
CS1371 Spring 2009 Test 2 – Practice Solutions 1. B 2. D 3. D 4. D 5. A 6. B 7. A 8. D 9. E 10. B 11. 12. Z-Axis 13. Surf
Background image of page 1

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

View Full DocumentRight Arrow Icon
14. th = linspace(0,2*pi); [uu tth] = meshgrid(u,th); vv = meshgrid(v,th); rr = vv; xx = uu; yy = rr.*cos(tth); zz = rr.*sin(tth); surf (xx,yy,zz) shading interp xlabel(‘ x-axis ’) ylabel(‘y -axis ’) zlabel(‘ z-axis ’) title(‘ Bodies of Rotation ’) Coding A Function Name: recursiveDiag Inputs: m (double)
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Outputs: diag (double) function diag=recursiveDiag(m) if isempty(m) diag=; else diag=[m(1), recursiveDiag(m(2:end,2:end)); end Coding B Function Name: bullzeye Inputs: n (double) rinc (double) r (double) coord (double) Outputs: none function bullzeye(n,rinc,r,coord) if n>0 hold on th=linspace(0,2*pi); plot(r*cos(th)+coord(1),r*sin(th)+coord(2)) bullzeye(n-1,rinc,r+rinc,coord) end...
View Full Document

Page1 / 2

CS1371_Fall_2008_Practice_Test_Soln - Outputs: diag...

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

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