Please explain for me this code , and what does each function do in detail ?
1 次查看(过去 30 天)
显示 更早的评论
function s=lagrangeP(x,X,Y)
format long
n=size(X);
L=ones(n);
for i=1:n
for j=1:n
if (i~=j)
L(i)=L(i).*(x-X(j))./(X(i)-X(j));
end
end
end
s=0;
for i=1:n
s=s+Y(i)*L(i);
end
0 个评论
回答(1 个)
Kevin Holly
2021-10-13
This was answered here:
3 个评论
Kevin Holly
2021-10-14
No problem. If this answers your question, I would appreciate it if you accepted the answer.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!