clear all, close all

T = [1971 1972 1974 1978 1982 1985 1989 1993 1997 1999 2000 2002 2003]';

X = [2250;
     2500;
     5000;
     29000;
     120000;
     275000;
     1180000;
     3100000;
     7500000;
     24000000;
     42000000;
     220000000;
     410000000;];

subplot(2,1,1)
plot(T,X,'.-'), xlabel('year'), ylabel('transistors')
subplot(2,1,2)
semilogy(T,X,'.-'), xlabel('year'), ylabel('transistors')

TT = T-T(1);
logX = log(X);

A = [ones(size(TT)) TT];
c = A\logX;
f = @(t) exp(c(1))*exp(c(2)*t);

figure()
semilogy(T,X,'.-',T,f(TT),'r'), xlabel('year'), ylabel('transistors')
