% lab05a.m   Generate a plot of the path of hurricane Katrina
% Donald Duck, section 019 for CISC106 lab05, 09/13/2007


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Print a message for the user, since generating a plot can take a while
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% We don't put a \n on this fprintf.  Leaving the cursor at the end
% of the line is a signal that the user should "wait patiently".

fprintf('Please wait while the plot is generated...');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load the data file, select out columns
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

katrina = load('katrina.dat');
longitude = katrina(:,4);
latitude = ____________;  %  FILL IN THE BLANK, THEN REMOVE THIS COMMENT

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Generate plot and add labels and a title
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

close all;  % close all previous figures that might be open

plot (-longitude,latitude);
legend('Katrina''s path');
title('Donald Duck''s plot of Katrina''s path for CISC106');


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Put plot on the web as a jpeg file 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

system('mkdir -p -m 755 ~/public_html/cisc106/lab05');  
print('-djpeg','~/public_html/cisc106/lab05/lab05a.jpg');
system('chmod -R 755 ~/public_html/cisc106/lab05/');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Tell the user we are finished, and where to find the plot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% The first printf has a \n at the beginning _and_ the end because we
% left the \n off on the earlier message (the "please wait..."
% message);

fprintf('\nDone!\n'); 

fprintf('Please visit http://copland.udel.edu/~youruserid/cisc106/lab05 to see your plot\n');


% end lab05a.m




