Lagrange polynomial giving me Inf in final form
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/396859/image.jpeg)
Can this be resolved?
5 comentarios
Respuestas (1)
KSSV
el 30 de Oct. de 2020
% clc; clear all ;
sp = [30 45 60 75 90 120];
mb = [2 4 9 17 27 82];
n=length(sp)-3;
syms x;
Q = 0;
for i = 1:n+1
M = 1;
for j = 1: n+1
if j~=i
M = M * (x - sp(j))/(sp(i)-sp(j));
end
end
Q = Q + mb(i)*M;
end
0 comentarios
Ver también
Categorías
Más información sobre Elementary Math en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!