Lagrange polynomial: two equivalent m-files
Mostrar comentarios más antiguos
I have a problem with the Lagrange polynomial in Matlab.
Here they write
% YY = LAGRANGEPOLY(X,Y,XX) returns the values of the polynomial
% sampled at the points specified in XX -- the same as
% YY = POLYVAL(LAGRANGEPOLY(X,Y)).
%
I understand that XX are the points at which the Lagrange polynomial is evaluated. But the the command after the second YY doesn't contain XX. So why these two YY are the same ? How can they be the same ??
4 comentarios
Must read:
YY = polyval(lagrangepoly(X,Y),XX)
instead of
YY = polyval(lagrangepoly(X,Y))
But why don't you simply run the code with the example provided ?
Jan
el 23 de Dic. de 2022
Respuestas (1)
the cyclist
el 23 de Dic. de 2022
0 votos
Assuming you are talking about this submission to the FEX, it is not from Mathworks. It is a user-contributed function. I guess you'd need to ask the author what they meant.
Categorías
Más información sobre Polynomials en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!