Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc, clear, close all;
- x1 = -2.5;
- y1 = -62;
- x2 = -1.5;
- y2 = -7.2;
- x3 = -.5;
- y3 = 8.3;
- x4 = 1;
- y4 = 3.7;
- x5 = 3;
- y5 = 45.7;
- A=[x1;x2;x3;x4;x5];
- B=[A.^4 A.^3 A.^2 A ];
- K=[y1;y2;y3;y4;y5];
- C=horzcat(B,[1;1;1;1;1],K);
- D=rref(C);
- F=D(:,6)
- hold on;
- plot(A,transpose(K),' o')
- syms x
- fplot((F(1)*x^4)+(F(2)*x^3)+(F(3)*x^2)+(F(4)*x)+F(5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement