load dessertdata          %Load dessert data
plot(temps,prices)            %Plot
hold
k4 = polyfit(temps,prices,4); %Fourth order fit
ft4 = polyval(k4,temps);    %Evaluate polynomial
plot(temps, ft4, 'r')       %Plot

k5 = polyfit(temps,prices,5); %Fifth order fit
ft5 = polyval(k5,temps);    %Evaluate polynomial
plot(temps, ft5, 'k')       %Plot

xlabel('Temperature (degrees F)')
ylabel('Prices (cents)')
title('Price change for ice pops on a July day')
legend('Temperature Data', 'Fourth Order Fit','Fifth Order Fit', 2)
