% Example m-file to plot daily high and low temperature in Shenandoah, IA % Brian Hornbuckle, January 15, 2008 clear all; load shen_1972_data.dat; % first column is day of June, 1972 % second column is high temperature % third column is low temperature d = shen_1972_data(:,1); % assign the first column of shen_1972_data to d h = shen_1972_data(:,2); % assign the second column of shen_1972_data to h l = shen_1972_data(:,3); % assign the third column to l % making these assignments makes it easier to % write the program figure(1) plot(d,h,'ro-',d,l,'bx-'); % plot high temp versus day, and low temp versus day grid on; % display a grid on the figure xlabel('day of June, 1972'); % label the x-axis ylabel('temperature, \circF'); % label the y-axis title('Shenandoah, IA'); % make a title legend('high temperature','low temperature',2); % make a legend axis([1,15,50,100]); % change the limits of the x- and y- axes % to make the figure look better