readPrecipFile - % fileName = name of file entered by user...

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

View Full Document Right Arrow Icon
function precip = readPrecipFile(fileName) % READPRECIPFILE reads the daily values of precipitation (in inches) from % the precipitation data file (151PRECP.DAT), converts them into an array % of daily precipitation values in centimeters and returns the array to % the invoking statement. % % BEE 1510: Introduction to Computer Programming % Laboratory Exercise Number 07 % Timothy Lin % TA: Celina % % Record of Revisions: % Original Code: October 16, 2008 % Last Revision: % % Variable Dictionary
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % fileName = name of file entered by user as string % precip = precipitation value in cm % precip_cm = precipitation value in cm % precip_in = precipitation value in in % in_cm = conversion factor from in to cm % % Parameters in_cm = 2.54; i % Read daily values of precipitation from precipitation data file (in) precip_in = textread(fileName); p % Convert precipitation values from in to cm precip_cm = precip_in*in_cm; precip = [precip_cm]'; p end % readPrecipFile...
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