{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture+27 - Engineering101 Engineering101 Lecture27...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Engineering 101 Engineering 101 Lecture 27 Lecture 27 12/11/07 12/11/07 singleStep Vectorization (Project 8  singleStep Vectorization (Project 8  Hint) Hint) MLC – Phase 4 MLC – Phase 4
Image of page 1

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

View Full Document Right Arrow Icon
Project 7 – singleStep – Part 1 Project 7 – singleStep – Part 1 function newT = singleStep(T, P, extTemp, t, dt) [rows, cols]=size(T); % Put T into an array with a border of one extra row/col % each cell in the border is set at the extTemp paddedT = extTemp .* ones(rows+2, cols+2); paddedT(2:end-1, 2:end-1) = T; % Compute neighbor terms newT = paddedT(1:end-2, 2:end-1) + ... paddedT(3:end, 2:end-1) + ... paddedT(2:end-1, 1:end-2) + ... paddedT(2:end-1, 3:end) - 4.0 * T; T T
Image of page 2
Project 7 – singleStep – Part 1 Project 7 – singleStep – Part 1 function newT = singleStep(T, P, extTemp, t, dt) [rows, cols]=size(T); % Put T into an array with a border of one extra row/col % each cell in the border is set at the extTemp paddedT = extTemp .* ones(rows+2, cols+2); paddedT(2:end-1, 2:end-1) = T; % Compute neighbor terms newT = paddedT(1:end-2, 2:end-1) + ... paddedT(3:end, 2:end-1) + ... paddedT(2:end-1, 1:end-2) + ... paddedT(2:end-1, 3:end) - 4.0 * T; eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT eT
Image of page 3

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

View Full Document Right Arrow Icon
Project 7 – singleStep – Part 1 Project 7 – singleStep – Part 1 function newT = singleStep(T, P, extTemp, t, dt) [rows, cols]=size(T); % Put T into an array with a border of one extra row/col % each cell in the border is set at the extTemp paddedT = extTemp .* ones(rows+2, cols+2); paddedT(2:end-1, 2:end-1) = T; % Compute neighbor terms newT = paddedT(1:end-2, 2:end-1) + ...
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}