AntecedentMoisture - for d = 2:5 am(d = 0 start the sum at zero for y = 1(d 1 am(d = am(d allWater(d y end for y = 1(d 1 end for d = 2:5 e THEN DO

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

View Full Document Right Arrow Icon
function am = antecedentMoisture(rain, snowmelt) f noDays = length(rain); allWater = rain + snowmelt; a % TAKE CARE OF FIRST FIVE DAYS OF THE DATA SET % assume final five days of previous period had no rain/snowmelt % % Record of coding % 23 September 2004, original coding, I. Z. Dormant % 7 October 2004 % % make antecedent moisture of day 1 equal to zero am(1) = 0; a % starting with day 2, sum from "yesterday" back to day 1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for d = 2:5 am(d) = 0; % start the sum at zero for y = 1:(d - 1) am(d) = am(d) + allWater(d - y); end % for y = 1:(d - 1) end % for d = 2:5 e % THEN DO THE REST OF THE DAYS IN THE DATA SET for d = 6:noDays am(d) = 0; % start the sum at zero for y = 1:5 am(d) = am(d) + allWater(d - y); end % for y = 1:5 end % for d = 6:noDays e end % function antecedentMoisture...
View Full Document

This note was uploaded on 09/28/2009 for the course BEE 1510 taught by Professor Staff during the Fall '05 term at Cornell University (Engineering School).

Ask a homework question - tutors are online