{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture+27

# Lecture+27 - Engineering101 Engineering101 Lecture27...

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

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

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

View Full Document
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

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

View Full Document
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) + ...
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}