T = [66 60 55 51.5 47 43 41 39 35]; t = [0 5.5 12 16.5 24.5 32.5 38.5 44 61]; % time has to start with 0 n = length(T); plot(t,T,'.'); Ts = 24; k = -log( (T(n) - Ts)/ (T(1) - Ts)) / t(n) % using the last observation to fit k hold on tc = 1:100; % plotting the curve plot(tc, Ts + (T(1) - Ts)*exp(-k*tc)); hold off % what if we used t(7) to fit k = -log( (T(7) - Ts)/ (T(1) - Ts)) / t(7) % using the 7-th observation to fit k hold on tc = 0:100; % plotting the curve plot(tc, Ts + (T(1) - Ts)*exp(-k*tc),'r'); hold off