Azzera filtri
Azzera filtri

Integrate a 2D gaussian over its FWHM

9 visualizzazioni (ultimi 30 giorni)
Sujay Ray
Sujay Ray il 6 Dic 2020
Risposto: Shadaab Siddiqie il 9 Dic 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);

Risposte (1)

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

Categorie

Scopri di più su Time Series in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by