x=[0.6-cos(0.6) 0.7-cos(0.7) 0.8-cos(0.8) 0.9-cos(0.9)] x = -0.2253356149096784 -0.0648421872844885 0.1032932906528347 0.2783900317293356 >> fx=[0.6 0.7 0.8 0.9] fx = 0.600000000000000 0.700000000000000 0.800000000000000 0.900000000000000 >> n=4 n = 4 >> for k=1:n Q(1:n,1)=fx; for i=2:n for j=2:i Q(i,j)=((0-x(i-j+1))*Q(i,j-1)-(0-x(i))*Q(i-1,j-1))/(x(i)-x(i-j+1)); end end end >> Q Q = 0.600000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.700000000000000 0.740401771115462 0.000000000000000 0.000000000000000 0.800000000000000 0.738565440250903 0.739142628241725 0.000000000000000 0.900000000000000 0.741007873694402 0.739026855928103 0.739090838888426 >> cos(Q(4,4)) ans = 0.739081289792984