solution16

solution16 - % Assignment 16 solutions % Prob 1 % method in...

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

% Assignment 16 solutions % Prob 1 % method in which all three curves are plotted with one plot command x=-1:0.01:1; y=0:1:3; [X,Y]=meshgrid(cos(pi*x/2),exp(-0.25*y)); T=20*X.*Y; plot(x,T(1,:),'-k',x,T(2,:),'--k',x,T(3,:),':',x,T(4,:),'-.k') xlabel('x'), ylabel('T') legend('y=0','y=1','y=2','y=3') title('Temperature Distribution in a Semi-Infinite Slab')

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

View Full Document
% Assignment 16 solutions % Prob 1b % method in which the hold command is used x=-1:0.01:1; y=0:1:3; [X,Y]=meshgrid(cos(pi*x/2),exp(-0.25*y)); T=20*X.*Y; plot(x,T(1,:),'-k') hold on plot(x,T(2,:),'--k') plot(x,T(3,:),':k') plot(x,T(4,:),'-.k') xlabel('x'), ylabel('T') legend('y=0','y=1','y=2','y=3') title('Temperature Distribution in a Semi-Infinite Slab') hold off
% Prob 1c % method in which the 'line' command is used x=-1:0.01:1; y=0:1:3; [X,Y]=meshgrid(cos(pi*x/2),exp(-0.25*y)); T=20*X.*Y; plot(x,T(1,:),'-k') line(x,T(2,:),'Linestyle', '--','color','k') line(x,T(3,:),'Linestyle',':','color','k') line(x,T(4,:),'Linestyle','-.','color','k')

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/27/2010 for the course ENME 271 taught by Professor Marks during the Summer '08 term at Maryland.

Page1 / 8

solution16 - % Assignment 16 solutions % Prob 1 % method in...

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

View Full Document
Ask a homework question - tutors are online