how to add a normal distribution to a figure?

8 vues (au cours des 30 derniers jours)
masoud avaznejad
masoud avaznejad le 5 Août 2020
Modifié(e) : Adam Danz le 25 Oct 2021
Hello
I want to creat this figure (regenrate paper)
now I got this one
how to add some normal distribution to my figure?
  3 commentaires
masoud avaznejad
masoud avaznejad le 5 Août 2020
I want to create some normal distribution with specific area between them and X axis
Adam Danz
Adam Danz le 10 Août 2020
Normal distributions (I'll call them Gaussians) are defined by two parameters, as minimum: center and width (mean and std). Given an area, there are lots of (infinite?) combinations of parameters that could result in that area.

Connectez-vous pour commenter.

Réponses (1)

Adam Danz
Adam Danz le 5 Août 2020
Modifié(e) : Adam Danz le 25 Oct 2021
You can use this fully parameterized guassian function explained here
It can be simplified if you don't need the vertical offset or amp terms.
gaus = @(x,mu,sig,amp,vo)amp*exp(-(((x-mu).^2)/(2*sig.^2)))+vo;
Alternatively, since the curves you shared show square waves and gaussians, you might be looking for a higher-order Gaussian or super-Gaussian function.
supGaus = @(x, sigma, center, amplitude, k) amplitude .* exp(-((x-center).^2/(2*sigma.^2)).^k);
  • x: a vector of x-values
  • sigma: width parameter
  • center: defines center of curve or the mean of the guassian
  • amplitude: defines the height of the curve
  • k: the 'shape' paramter which determines the steepness of falloff and how flat the top of the curve is. When k=1 the curve will be Gaussian. When k=inf the curve will be a step function.
x = 400:5:2100;
center = 1260;
sigma = 250;
amplitude = 60;
% showing results for various k=values defined in legend

Catégories

En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by