Creat a new function using integral function
Mostrar comentarios más antiguos
Hi, I want to create a function using integral function in matlab. For example, I have a function F(t,u) and want integrate this F(t,u) function with respect to 't' only from (u, 100). Specifically, I want to have a function of 'u' by G(u)=integral(F(t,u), u, 100). How can I get this function?
Respuestas (1)
John D'Errico
el 24 de Feb. de 2015
Editada: John D'Errico
el 24 de Feb. de 2015
Assuming the limits on t are [u,100] as you stated...
G = @(u) integral(@(t) F(t,u),u,100);
You can evaluate G(u) at any point u. Note that G will NOT be vectorized, so as I've written it, G will accept only scalar inputs. You should be able to do that simply enough with a tool like arrayfun though.
Categorías
Más información sobre Numerical Integration and Differentiation 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!