How to determine correlation coefficient from histfit?

7 views (last 30 days)
I read this page:
I generated a histogram with a gaussian fit using histfit but I also need the correlation coefficient for the fit to the data. How do I obtain it?
current code:

Answers (1)

Rajesh Balagam
Rajesh Balagam on 18 Sep 2017
"histfit" function does not output any measurements related to the fitted distribution. You can use either "fitdist" function or "distributionFitter" GUI tool for the same.
Correlation coefficient measures correlation between two variables and may not have relevance in this context. If you are referring to a measure of goodness of fit, both the above functions provide log-likelihood values ( You can access this value from the result as shown below.
pd = fitdist(data,'normal')


More Answers in the  ThingSpeak Community


Community Treasure Hunt

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

Start Hunting!