This preview shows page 1. Sign up to view the full content.
Unformatted text preview: % create empty daily average air temperature array tp = [ ]; % start with empty array % check to be sure the file has full days of data, abort if not true if (mod(length(hrTemps), 24) ~= 0) disp('Data file does not contain a full number of days!'); else % calculate the number of days in the data set days = length(hrTemps)/24; % average 24 hourly values for each day for d = 1:days temps(d) = 0; % initialize summing variable to zero for h = 1:24 % sum 24 hours of data temps(d) = temps(d) + hrTemps(24*(d-1) + h); end % for h = 1:24 tp = [tp temps(d)/24]; % concatenate day averages to tp, by element end % for d = 1:days end % if (mod(length(hrTemps), 24) ~= 0) end % function readTempFile...
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).
- Fall '05