temperature_update - % % INPUTS: List them below one line...

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

View Full Document Right Arrow Icon
function finaltemp=temperature_update(matrix,row,column) f %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % Programmer(s) and Purdue Email Address(es): % % 1. rpereir@purdue.edu % % % Section #: 07 % % % Assignment #: Homework 3 activity 1 % % % Academic Integrity Statement: % % % I/We have not used source code obtained from % % any other unauthorized source, either modified % % or unmodified. Neither have I/we provided access % % to my/our code to another. The project I/we am/are % % submitting is my/our own original work. % % % FUNCTION NAME: The purpose of this function is to calculate the updated % % temperature for the middle of the grid based off its surroundings.
Background image of page 1

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

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

Unformatted text preview: % % INPUTS: List them below one line per input argument % % matrix, row, column % % OUTPUTS: List them below line per output argument % % finaltemp - final temperature % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % finaltemp=(matrix(row-1,column)+matrix(row,column+1)+matrix(row+1,column) +matrix(row,column-1))/4; %this is the formula that calculates the updated temperature t t % temperature_update([100,100,100,100;100,50,50,100;100,37.5,37.5,100;50,50,50,50],2, 3) 3 % % % ans = % % % % 71.8750 % % % % temperature_update([78,67,60,48;65,61,53,40;60,55,46,30;55,45,37,29],3,2) % % % % ans = % % % % 53 % end...
View Full Document

This note was uploaded on 09/20/2011 for the course ENGINEERIN 132 taught by Professor Lee during the Spring '11 term at Purdue University-West Lafayette.

Page1 / 2

temperature_update - % % INPUTS: List them below one line...

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

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