compute numerical integral by matlab

1 visualización (últimos 30 días)
reem
reem el 7 de Abr. de 2011
Hello everybody Please,I want to know,how compute integral from 2 to infinity for any function using matlab? thanks in advance

Respuesta aceptada

Matt Fig
Matt Fig el 7 de Abr. de 2011
Put the function in an anonymous function, then use QUADGK.
  3 comentarios
Matt Fig
Matt Fig el 7 de Abr. de 2011
Don't put the keyword: function in a script or at the command line. Just do this:
y=@(X)(1/sqrt(2*pi))*exp(-0.5*X.^2); % Anonymous func.
Q=quadgk(y,2,inf)
reem
reem el 7 de Abr. de 2011
Thank you so so so much
you are very kind and smart
I hope all best things for you
Kind regards

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by