Please explain for me this code , and what does each function do in detail ?
조회 수: 10 (최근 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!
