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
John D'Errico 2015년 2월 24일
편집: John D'Errico 2015년 2월 24일

1 개 추천

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에 대해 자세히 알아보기

질문:

2015년 2월 24일

편집:

2015년 2월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by