function [T] = cooling ()
clear
T(1)=1000  % initial temperature
Ta=30      % ambient temperature
q = 0.2    % cooling coefficient

N=60     % 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')

sprintf('Temperature in 5th minute = %f',T(5)) 
    %create a string to be displayed
sprintf('Temperature in 10th minute = %f',T(10)) 
sprintf('Temperature in 30th minute = %f',T(30)) 
sprintf('Temperature in 60th minute = %f',T(60)) 
    
end