Please explain for me this code , and what does each function do in detail ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Kevin Holly
am 13 Okt. 2021
This was answered here:
3 Kommentare
Kevin Holly
am 14 Okt. 2021
No problem. If this answers your question, I would appreciate it if you accepted the answer.
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!