MATLAB is taking too much time to solve the following integral?

조회 수: 4 (최근 30일)
chaaru datta
chaaru datta 2022년 6월 11일
댓글: chaaru datta 2022년 6월 13일
Hello all, I am trying to solve the following integral but MATLAB is taking too long to solve it.
---- (1)
where is lower incomplete Gamma function, x is variable of integration and all other things are constant.
Any help in this regard will be highly appreciated.
  댓글 수: 1
chaaru datta
chaaru datta 2022년 6월 11일
I tried to write the MATLAB code for first lower incomplete Gamma function but got the following error: Limits of integration must be double or single scalars.
Here is the code that I had written:
G = @(x)((gam_s*(1+x)-1)/(A*sig2_fsnrn));
G1 = @(x) x/(A1*sig2_fsnen);
fun = @(t) t.^(1+d-1).*exp(-t);
low_gam = integral(fun,0,G);

댓글을 달려면 로그인하십시오.

채택된 답변

Dyuman Joshi
Dyuman Joshi 2022년 6월 11일
편집: Dyuman Joshi 2022년 6월 11일
integral is used for numerical integration of functions, not partial integrations. It expects numerical value for 2nd and 3rd input.
Check out gammainc to define lower incomplete gamma function.
  댓글 수: 9
chaaru datta
chaaru datta 2022년 6월 13일
I know about this function also. However if I use it then it gives me the error : Inputs must be real, full, and double or single.
chaaru datta
chaaru datta 2022년 6월 13일
Thank you so much @Torsten sir and @Dyuman Joshi sir. Its because of your suggestions, I could implement and plot the equation in MATLAB.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Gamma Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by