Creat a new function using integral function
Show older comments
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?
Answers (1)
John D'Errico
on 24 Feb 2015
Edited: John D'Errico
on 24 Feb 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.
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!