HW3_solution - % this file is 'hw3_3.m' % you may have...

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

View Full Document Right Arrow Icon
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
file:///C|/Documents%20and%20Settings/PGE-PC/Desktop/Scanned%20Items/solution_hw3_3.txt fid=fopen('Austin_T.txt','rt'); headings=fgetl(fid) a=fscanf(fid,'%f'); fclose(fid); temp=reshape(a,4,29)'; date=temp(:,1); Tmax=temp(:,2); Tmean=temp(:,3); Tmin=temp(:,4); date_length=length(date); sum=0; for i = 1: date_length t_max=conversion(Tmax(i)); t_mean=conversion(Tmean(i)); t_min=conversion(Tmin(i)); if ((t_max-t_min)>14) sum=sum+1; fprintf( 'TA may catch a cold in %d day \n', i); elseif (t_mean<12.5) sum=sum+1; fprintf( 'TA may catch a cold in %d day \n', i); end end fprintf('TA may catch a cold in %d days \n',sum);
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % this file is 'hw3_3.m' % you may have multiple different ways to do the job, the final answer from the program should be 22. file:///C|/Documents%20and%20Settings/PGE-PC/Desktop/Scanned%20Items/solution_hw3_3.txt [2/12/2009 2:31:39 PM] file:///C|/Documents%20and%20Settings/PGE-PC/Desktop/Scanned%20Items/conversion.t.txt function [t]=conversion(T) t=(T-32)*5/9; % this file is named 'conversion.m' file:///C|/Documents%20and%20Settings/PGE-PC/Desktop/Scanned%20Items/conversion.t.txt [2/12/2009 2:31:39 PM]...
View Full Document

Page1 / 5

HW3_solution - % this file is 'hw3_3.m' % you may have...

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