Quiz10_Solution - x = -3:0.1:3; y = x; [X,Y] =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Quiz 10: 3-D Plotting Name: ASE 201 Write the code that will plot f ( t ) = e - 0 . 5 t cos 5 t g ( t ) = e - 0 . 5 t sin 5 t for 0 t 10 with an increment of 0.01 and z ( x,y ) = xy e - ( x 2 + y 2 ) for - 3 x 3 and - 3 y 3 with an increment of 0.1. You should have SEPARATE plots but that are on the SAME figure. You should choose a plotting function that accu- rately shows each function. Be sure to include appropriate labels to each plot. Solution: %quiz10 clear all close all t = 0:0.01:10; f = exp(-0.5*t).*cos(5*t); g = exp(-0.5*t).*sin(5*t);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x = -3:0.1:3; y = x; [X,Y] = meshgrid(x,y); Z = X.*Y.*exp(-1*(X.^2+Y.^2)); figure; subplot(1,2,1) plot3(f,g,t,LineWidth,2) xlabel(f(t),FontSize,12) ylabel(g(t),FontSize,12) zlabel(t,FontSize,12) grid on subplot(1,2,2) surf(X,Y,Z) % or mesh or contour, etc. xlabel(x,FontSize,12) ylabel(y,FontSize,12) zlabel(z(x,y),FontSize,12)...
View Full Document

This note was uploaded on 02/14/2010 for the course ASE 201 taught by Professor Hayes during the Spring '07 term at University of Texas at Austin.

Ask a homework question - tutors are online