Creat a new function using integral function
显示 更早的评论
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?
回答(1 个)
John D'Errico
2015-2-24
编辑:John D'Errico
2015-2-24
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!