Next Spaceship

Driving into future…

Polynomial

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
%2008.4.16
clear;
t=[0.0 0.5 1.0 6.0 7.0 9.0]
y=[0.0 1.6 2.0 2.0 1.5 0.0]
for i=1:6
    for j=0:5
        A(i,j+1)=t(i)^j;
    end
end
x=A\y';
syms m n;
m=0;
for i=0:5
    m=m+x(i+1)*n^i;
end
m
n=0:.1:9;
m=subs(m);
plot(n,m);
%plot(t,y,'d');

Comments