CS1371_Fall_2008_Practice_Test_Soln

# CS1371_Fall_2008_Practice_Test_Soln - Outputs diag(double...

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

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

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

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

## This note was uploaded on 09/11/2009 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.

### Page1 / 2

CS1371_Fall_2008_Practice_Test_Soln - Outputs diag(double...

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

View Full Document
Ask a homework question - tutors are online