heat - end if i==1 B(C) = B(C) + 20/4; else A(C,C-p) =...

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

View Full Document Right Arrow Icon
%Script File: heat transfer %Harrison Jackson p = 8; n= p^2; A = zeros(n,n); B= zeros(n,1); C = 1; for i = 1:p for j=1:p A(C,C)=1; if j==p B(C) = B(C) + 40/4; else A(C,C+1) = -1/4; end if j==1 B(C) = B(C) + 10/4; else A(C,C-1) = -1/4;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: end if i==1 B(C) = B(C) + 20/4; else A(C,C-p) = -1/4; end if i==p B(C) = B(C) + 30/4; else A(C, C+p) = -1/4; end C=C+1 end end T= A\B; Tplot = reshape(T,p,p); surf(Tplot);...
View Full Document

This note was uploaded on 11/11/2009 for the course MATH 3353 taught by Professor Thomashagstrom during the Spring '09 term at SMU.

Ask a homework question - tutors are online