Borrar filtros
Borrar filtros

Fit Multiple gaussian curve on data with flat tops

24 visualizaciones (últimos 30 días)
AMIT
AMIT el 3 de Jul. de 2024 a las 0:19
Respondida: Sam Chak el 3 de Jul. de 2024 a las 7:43
How to fit double gaussian curve for this data set which is flat at some domains?
  2 comentarios
Alex Sha
Alex Sha el 3 de Jul. de 2024 a las 6:56
Would you please give out all data in a file?
Umar
Umar el 3 de Jul. de 2024 a las 7:22
Hi Alex,
Due to limited resources and being poor, this is the best I can do at the moment. Hope you understand my point.

Iniciar sesión para comentar.

Respuestas (2)

Umar
Umar el 3 de Jul. de 2024 a las 3:34

Hi Amit,

You asked, How to fit double gaussian curve for this data set which is flat at some domains?

To answer your question, use the fit function along with a custom equation that represents the double Gaussian curve. I can provide a basic example to get you started:

I will generate example data with two Gaussian peaks and some noise.

>> % Generate example data x = linspace(0, 10, 100); y = 2*exp(-(x-3).^2) + 1.5*exp(-(x-7).^2) + 0.5*randn(size(x));

Use the fit function with the gauss2 model to fit the double Gaussian curve to the data.

% Fit a double Gaussian curve f = fit(x', y', 'gauss2');

Finally, plot the original data points along with the fitted curve for visualization.

% Plot the data and the fitted curve plot(x, y, 'o') hold on plot(f, x, y) legend('Data', 'Fitted Curve')

For more information on fit function, please refer to

https://www.mathworks.com/help/curvefit/fit.html

Hope this will help resolve your problem.


Sam Chak
Sam Chak el 3 de Jul. de 2024 a las 7:43
For a double-hump data with plateaux, you can try fitting it using two Exponential Power distribution functions. Let's take a look at how the function looks like:
x = -5:0.01:5;
a = 1;
b = 1/sqrt(2);
c = 1/sqrt(2);
d = 0;
e = 8; % exponent (in Gaussian, e = 2)
y = a*exp(-((x - (-c))/b).^e) + a*exp(-((x - c)/b).^e) + d;
plot(x, y, 'r.'), grid on, axis([-6 6, -0.2 1.2]), xlabel('x'), ylabel('y')
title('Double-hump with plateaux')

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Productos


Versión

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by