%   CDS130-003, Spring 2013
% HW#8 on differentail equation: cooling law

clear; clf
T(1)=1500  % initial temperature
Ta=10      % ambient temperature
q = 0.1    % cooling coefficient

N=80     % interval 60 minutes

for i=[1:N-1]
   T(i+1)=T(i)-q*(T(i)-Ta);
end

plot(T,'-*b');
xlabel('Time (min)')
ylabel('Temperature (deg)')
title('cooling curve','FontSize',18)
legend('Temperature')