How to Normalize a Histogram without using fitdist and pdf or any other fitting functions?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to create a histogram for a set of data that is normalized, i.e the sum of the bins or area under the curve is = 1. However, fitdist or histfit apply a fit and does not simply normalize the curve. Attached are two images. The first is the histogram I need to normalize, and the second immage is the histogram when I use fitdist. I need to insure that the histogram has a total area of 1 without using a fitting function that will manipulate the actual data. How do I nomalize the data without changing/fitting its acual values?
x_values = 0:0.01:5;
xx_values = 0:0.01:5;
data1 = load('343E_SCX_0p001-deviations.csv'); %343 Grain
len=length(data1);
limit=len/2+1;
StnDev1=reshape(data1(10,3:limit),len/2-1,1);
StsDev1=reshape(data1(10,limit+1:end),len/2-1,1);
pd = fitdist(StnDev1,'Normal');
y = pdf(pd,x_values);
%histogram(StnDev1);
plot(x_values,y,'b','LineWidth',2)
hold on
0 commentaires
Réponse acceptée
the cyclist
le 6 Sep 2021
Use the 'Normalization' Name-Value pair to the histogram function:
x_values = 0:0.01:5;
xx_values = 0:0.01:5;
data1 = load('343E_SCX_0p001-deviations.csv'); %343 Grain
len=length(data1);
limit=len/2+1;
StnDev1=reshape(data1(10,3:limit),len/2-1,1);
histogram(StnDev1,'Normalization','probability')
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Probability Distributions 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!