Advertisement
franciscominajas

d

Nov 21st, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.82 KB | None | 0 0
  1. %definimos los vectores con informacion
  2. t=[160,180,200,220,240,260,280,300];
  3. v=[10.293372,10.330671,10.368179,10.405925,10.443936,10.482245,10.520884,10.559888];
  4. figure (1)
  5. plot(t,v,'o','markerfacecolor','r');
  6.  
  7. syms T
  8.  
  9. L(1)=((T-t(2))*(T-t(3))*(T-t(4))*(T-t(5)))/((t(1)-t(2))*(t(1)-t(3))*(t(1)-t(4))*(t(1)-t(5)));
  10. L(2)=((T-t(2))*(T-t(3))*(T-t(4))*(T-t(5)))/((t(2)-t(1))*(t(2)-t(3))*(t(2)-t(4))*(t(2)-t(5)));
  11. L(3)=((T-t(2))*(T-t(3))*(T-t(4))*(T-t(5)))/((t(3)-t(1))*(t(3)-t(2))*(t(3)-t(4))*(t(3)-t(5)));
  12. L(4)=((T-t(2))*(T-t(3))*(T-t(4))*(T-t(5)))/((t(4)-t(1))*(t(4)-t(2))*(t(4)-t(3))*(t(4)-t(5)));
  13. L(5)=((T-t(2))*(T-t(3))*(T-t(4))*(T-t(5)))/((t(5)-t(1))*(t(5)-t(2))*(t(5)-t(3))*(t(5)-t(4)));
  14.  
  15. P=v(1)*L(1)+v(2)*L(2)+v(3)*L(3)+v(4)*L(4)+v(5)*L(5);
  16.  
  17. figure (2)
  18. ezplot(P,[min(t),max(t)]);
  19. vpa(abs(subs(P,t)))
  20. vpa(abs(subs(P,100)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement