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

2 views (last 30 days)
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 Comment
chaaru datta
chaaru datta on 11 Jun 2022
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);

Sign in to comment.

Accepted Answer

Dyuman Joshi
Dyuman Joshi on 11 Jun 2022
Edited: Dyuman Joshi on 11 Jun 2022
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 Comments
chaaru datta
chaaru datta on 13 Jun 2022
Thank you so much @Torsten sir and @Dyuman Joshi sir. Its because of your suggestions, I could implement and plot the equation in MATLAB.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!