MATLAB - add a fitted distribution curve to a histogram

12,240

Solution 1

Is this what you want?

Distribution Fitting (C) Mathworks http://www.mathworks.com/products/demos/shipping/stats/cfitdfitdemo_06.png

If so, check the Mathworks page on Curve Fitting and Distribution Fitting

Solution 2

What you want is the "hold" command. It keeps the current plot/axes in place and enables you to put a new plot on top of another one. E.g.:

hist(somedata);
hold;
plot(someotherdata);

see here

Share:
12,240
Admin
Author by

Admin

Updated on June 16, 2022

Comments

  • Admin
    Admin almost 2 years

    I'd like to fit a distribution curve to my data, and plot it on top of a histogram of the data.

    I can't find how to do it (I'm a MATLAB beginner).