Lecture+27 - Engineering 101 Engineering 101 Lecture 27...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 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 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 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 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) + ......
View Full Document

This note was uploaded on 03/12/2010 for the course ENGIN 101 taught by Professor Jeffringenberg during the Fall '07 term at University of Michigan.

Page1 / 15

Lecture+27 - Engineering 101 Engineering 101 Lecture 27...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online