I've seen something similar answered a few times here, but none of the solutions work for me.
I have 1D data that I want to fit as 3 Gaussian functions. So, I do a simple:
The problem now is that I cannot display this. One of the answers on here proposed something like this:
But this produces all kinds of errors.
The examples I've seen on the web use the pdf function, but I don't really understand what the second argument should be? Is that the x values of my series? Or the peaks of my Gaussians? Or something else? Also, do I plot it with 'plot', or 'ezcontour' or something else?
Any help with this would be greatly appreciated.
P.S. Maybe I'm too beginner to understand, but the web page for this function is super useles... It only gives examples with contour plots and 2D, and for visualization the first example is:
gmPDF = @(x1,x2)reshape(pdf(GMModel,[x1(:) x2(:)]),size(x1));
g = gca;
Which I cannot make heads or tails of... What are x1 and x2? What does the @ at the start do? Where did g.XLim and g.YLim come from?