clear all, %close all, clc
u = [70  85  85  50  30  25  25  30  60  65]';
t = [0:5:45]';
tFin = [0:1:45]';

uP = u(2:2:10)
tP = t(2:2:10)
A  = [tP.^0  tP  tP.^2  tP.^3  tP.^4]
c  = A\uP

AFin = [tFin.^0  tFin  tFin.^2  tFin.^3  tFin.^4];
P = AFin*c;

plot (tFin, P, t, u, '*'), hold on
Residual_vid_5_minuter = P(6) - u(2)

AMKM =  [t.^0  t  t.^2  t.^3  t.^4];
cMKM = AMKM\u;
PMKM = AFin*cMKM;
plot (tFin, PMKM, '--')