Multiplying Function Handles in Product of Sequence application

1 visualización (últimos 30 días)
Hasan Khan
Hasan Khan el 6 de Mzo. de 2015
Respondida: Youssef El Seblani el 25 de Mzo. de 2018
Hi
I have the following equation that I need to code up as a single function.
The output function handle would contain the function for the passed value of k.
I was planning of making individual function handles for each value of k and then multiply them in a FOR loop, but that does not seem to work. Any ideas?
Thanks,
Hasan

Respuestas (1)

Youssef El Seblani
Youssef El Seblani el 25 de Mzo. de 2018
function [li]=lagrange(x,i) c=x(i); x(i)=[]; syms X; f(X)=prod( (X-x)./(c-x)); li=f(X); end

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!

Translated by