HW6 #3 - .. xlabel('x'),. .. ylabel('y'),. .....

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

View Full Document Right Arrow Icon
Sheet1 Page 1 %Engineering 6, Spring 2004, Problem 6.3 %Ryan Uy, 2509 %Section B05, Tues. 3-4 % rcu6_3.m % Create a mesh plot and contour plort for the temeprature of a 3m X 3m % plate on two seperate plots, for x between 0 and 3 and y between 0 and % 3, each at intervals of 0.15. Temparature is defined as: % T = 87 e^(-0.2(x-3)^2) e^(-0.2(y-3)^2) x = (0:0.15:3) y = (0:0.15:3) [x y] = meshgrid(x,y) T = 87.*exp(-0.2.*((x-3).^2)).*exp(-0.2.*((y-3).^2)) %plot graphs subplot(2,1,1), mesh(x,y,T),. ..%mesh plot first title('Temperature of Plate Heated to 87 deg. at Corner (3,3)'),. .. xlabel('x'),. .. ylabel('y'),. .. zlabel('Temperature'),. .. axis([0 3 0 3 0 100]) subplot(2,1,2), contour(x,y,T),. ..%contour plot second title('Contour Plot of Temperature'),.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .. xlabel('x'),. .. ylabel('y'),. .. zlabel('Temperature'),. .. axis square % Calculate the temparature at the middle of the plate and display the % result to 1 decimal place. x_mid = 1.5 y_mid = 1.5 middle_temp = 87*exp(-0.2*((x_mid-3)^2))*exp(-0.2*((y_mid-3)^2)) fprintf('Temperature at middle of plate: %.1f',middle_temp) Sheet1 Page 2 %create x values from 0 to 3 in 0.15 increments %create y values from 0 to 3 in 0.15 increments %use meshgrid function to generate an open mesh plot %function T (temperature) %set axes from 0 to 3 for x and y, 0 to 100 for z %set square axis %middle of plate has x-coordinate 1.5 %middle of plate has y-coordinate 1.5 %calculate temperature at middle of plate...
View Full Document

This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Spring '06 term at UC Davis.

Page1 / 2

HW6 #3 - .. xlabel('x'),. .. ylabel('y'),. .....

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