clear, clc, clf
t=(0:4)';
x=[0.7 0.61 0.55 0.45 0.40]';
A=[ones(size(t)) -t];
b=log(x);
ak=A\b;
k=ak(2)
x0=exp(ak(1))
plot(t,x,'o')
hold on
xlin=0:0.02:4;
ylin=x0*exp(-k*xlin);
plot(xlin, ylin)

A2=[-t];
b2=log(x)-log(0.7);
k2=A2\b2;
ylin2=0.7*exp(-k2*xlin);
plot(xlin, ylin2)