﻿disp("Exercise 2");
function Q = nevnew(x,y)
n=length(x); %sets n to how many x are in the array
for i=1:n %starts the array at 1 up to n
Q(i,1)=y(i); %sets the first colum to the y value
end
for j=2:n %adds new values to the rows
for i=1:n+1-j; %sets the values of i
Q(i,j)=((xhat-x(i))*Q(i+1,j-1)-(xhat-x(i+j-1))*Q(i,j-1))/(x(i+j-1)-x(i)); %computes f11 f12 and f02 
end%for
end%for
end%function

