% tempPlot1.m   P.Conrad for CISC106
% an unsuccessful attempt to plot mean temperature for 9/1/2006
% through 10/25/2006 


% load the data file.   This version of the load command
% uses a string argument to the load function and stores
% the result in a matrix called "data" instead of "sepOctTemps"

data = load('sepOctTemps.dat');

% pull out the columns we want to plot into separate vectors
% we want to put day on the x axis, and mean temp on the y axis
% see the data file itself for a comment that describes the columns

day = data(:,3);
meanTemp = data(:,5);

% plot day on x axis, meanTemp on y, and label the axes

plot(day,meanTemp);

xlabel('day');
ylabel('mean temperature (degrees F)');
title('Mean Temperature in Wilmington DE (take 1, not very good)');

% put the resulting file on the web 

jpegFilename = 'tempPlot1.jpg';

!mkdir -p -m 755 ~/public_html/cisc106/lab08
fulljpegFilename = ['~/public_html/cisc106/lab08/' jpegFilename];
print('-djpeg',fulljpegFilename);
!chmod -R 755 ~/public_html/cisc106/lab08

% use the function makeURL to turn the filename into a URL

theURL = cisc106URL('lab08',jpegFilename);

fprintf ('Plot written to %s\n',theURL);

