% jan12 2017 inclass assignment
clear all
close all
%for info on the data
%http://utahavalanchecenter.org/alta-monthly-snowfall
%download the data from http://chpc.utah.edu/~u0035056/5040/data
a = csvread('alta_snow.csv');
%column 1 is the year and column 8 is the seasonal total
yr = a(:,1);
ny = length(yr);
tot = a(:,8)*2.54;
% determine max value and index value of max
[maxs,mxi] = max(tot)
% write to screen the year when max occurred
yr(mxi)
%repeat for min
[mins,mni] = min(tot)
yr(mni)

%plot time series of snow totals as bar chart
figure(1)
bar(yr,tot)
axis('tight')
title('Alta water year snow total (cm) John Horel 1/12/17')
xlabel('Year')
ylabel('Snow total (cm)')
grid