I’m not aware of one.
One approach that avoids the need to extract the parameters of the distribution and calculate the curve at the histogram centres:
r = normrnd(10,1,100,1);
h = histfit(r,10,'normal');
bars = h(1);
curve = h(2);
curve_at_bars = interp1(curve.XData, curve.YData, bars.XData, 'pchip');
resid = curve_at_bars - bars.YData;
The 'pchip' interpolation method would probably be more appropriate than the alternatives here.
I don’t know what data you will actually be analysing, so I don’t know if this approach is appropriate to them.
Best Answer