% zadanie 1
load("linear_regression.mat")
A = [x ones(size(x))];
L = -y;
X = -inv(A'*A)*(A'*L)
V = A * X + L;
A'*V 

% zadanie 2
load ("polynomial3_regression.mat")
A = [x.^3 x.^2 x ones(size(x))];
L = -y;
X = -inv(A'*A)*(A'*L)
V = A * X + L;
A'*V 

