From: SM on
Hi,

I have a set of data in a way the there could be several "y" correspinding to each x (so above each x point several dots may appear while plotting). I created the scatter plot. It's happened that this has a bell curve model (Gaussian model). I want to fit the bell curve to this data and then plot the model together with the data poit.

Is there any way to do this?
Thanx ina dvance
From: someone on
"SM " <khanmoradi(a)gmail.com> wrote in message <hntkrg$77m$1(a)fred.mathworks.com>...
> Hi,
>
> I have a set of data in a way the there could be several "y" correspinding to each x (so above each x point several dots may appear while plotting). I created the scatter plot. It's happened that this has a bell curve model (Gaussian model). I want to fit the bell curve to this data and then plot the model together with the data poit.
>
> Is there any way to do this?
> Thanx ina dvance

Take a look at gaussiian-curve-fit from the MATLAB FEX at:

http://www.mathworks.com/matlabcentral/fileexchange/11733-gaussian-curve-fit
From: Wayne King on
"SM " <khanmoradi(a)gmail.com> wrote in message <hntkrg$77m$1(a)fred.mathworks.com>...
> Hi,
>
> I have a set of data in a way the there could be several "y" correspinding to each x (so above each x point several dots may appear while plotting). I created the scatter plot. It's happened that this has a bell curve model (Gaussian model). I want to fit the bell curve to this data and then plot the model together with the data poit.
>
> Is there any way to do this?
> Thanx ina dvance

In addition to Someone's suggestion, if you have the Curve Fitting Toolbox, fit() has exponential and Gaussian options:

>>doc fit

>>doc cflibhelp

Wayne
From: SM on
Got a question now! What if we don't know sigma and mean or one of them ?
From: SM on
I am trying to fit the curve for instance to the below set
x=1:1:13;
y=[0 1.593 12.1699 4.9967 14.9635 13.9223 32.629 26.6822 47.6412 16.589 47.6483 2.09 0];

it doesn't work. Is it probably because of the initial values for sigma and mean?

Thanks for your comments...