Integrate a 2D gaussian over its FWHM

13 views (last 30 days)
Sujay Ray
Sujay Ray on 6 Dec 2020
Answered: Shadaab Siddiqie on 9 Dec 2020
Hi,
I need some help to integrate over a 2D gaussian function below... with limits (x0-FEHMx/2) to (x0+FEHMx/)2 and (y0-FEHMy/2) to (y0+FEHMy/2).
function F = D2GaussSingle(x,xdata)
F = x(1)*exp( -((xdata(:,:,1)-x(2)).^2/(2*x(3)^2) + (xdata(:,:,2)-x(4)).^2/(2*x(5)^2) ) )+x(6) ;
end
I am not sure how to integrate and parametrize at the same time. Lets say My gaussian fit gives me values of x as [5000, 0,2.5,-0.1,2.4,500] ; (parameters [Amp,xo,wx,yo,wy,background]). I have tried the following but am not able to get it to work. can someone please help.
fun=@ D2GaussSingle(x);
sumN = integral2(fun,x(2)-FWHMx/2,x(2)+FWHMx/2,x(4)-FWHMy/2,x(4)+FWHMy/2);
fun = @(x,xdata)D2GaussSingle(x,xdata);
n = integral(@(xdata)fun(x,xdata),0,100);

Answers (1)

Shadaab Siddiqie
Shadaab Siddiqie on 9 Dec 2020
From my understanding you want integrate a 2D function here is a integration resource which might help you.

Categories

Find more on Time Series 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!