# Thread: I need the function for a Gauss curve

1. ## I need the function for a Gauss curve

Hello,

I am doing a fuzzy logic simulation and I need a function that will generate values for me. These values need to approximate a Gauss (Bell, Normal) Curve for a particular range. I need it to generate the y value for a given x. The left side will of course be located at (0,0), the top should be (6,1) and the rightmost side should be (12,0). I can't for the life of me remember how to do something like this and I need this fuction for this project due this weekend.

Thanks a ton for any help.

Polecat

2. Originally Posted by polecat1
Hello,

I am doing a fuzzy logic simulation and I need a function that will generate values for me. These values need to approximate a Gauss (Bell, Normal) Curve for a particular range. I need it to generate the y value for a given x. The left side will of course be located at (0,0), the top should be (6,1) and the rightmost side should be (12,0). I can't for the life of me remember how to do something like this and I need this fuction for this project due this weekend.

Thanks a ton for any help.

Polecat
As Gaussian (Bell) curve centered at 0 has the equation:
$\displaystyle y = e^{-x^2}$
and stretches to $\displaystyle \pm \infty$ on each side. You can't terminate it on one end or the other.

-Dan

3. Originally Posted by topsquark
As Gaussian (Bell) curve centered at 0 has the equation:
$\displaystyle y = e^{-x^2}$
and stretches to $\displaystyle \pm \infty$ on each side. You can't terminate it on one end or the other.

-Dan
Are you sure?

I think it should be,
$\displaystyle \frac{1}{\sqrt{2\pi}} e^{-x^2/2}$

Because in the way you said it, it is not a probability density function since $\displaystyle \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$.

4. Originally Posted by ThePerfectHacker
Are you sure?

I think it should be,
$\displaystyle \frac{1}{\sqrt{2\pi}} e^{-x^2/2}$

Because in the way you said it, it is not a probability density function since $\displaystyle \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$.
(chuckles) Okay! Okay! What he said.

-Dan

5. Originally Posted by polecat1
Hello,

I am doing a fuzzy logic simulation and I need a function that will generate values for me. These values need to approximate a Gauss (Bell, Normal) Curve for a particular range. I need it to generate the y value for a given x. The left side will of course be located at (0,0), the top should be (6,1) and the rightmost side should be (12,0). I can't for the life of me remember how to do something like this and I need this fuction for this project due this weekend.

Thanks a ton for any help.

Polecat
Do you want a normal random number generator?

RonL

6. Originally Posted by polecat1
I am doing a fuzzy logic simulation and I need a function that will generate values for me. These values need to approximate a Gauss (Bell, Normal) Curve for a particular range. I need it to generate the y value for a given x. The left side will of course be located at (0,0), the top should be (6,1) and the rightmost side should be (12,0).
There are several "bell shaped" curves with finite support commonly used to define fuzzy membership functions, which are not Gaussian (which has infinite support), such as the generalize bell curve and the pi curve. See, for instance:

Generalized Bell Curve

Pi Curve

-Will Dwinnell
Data Mining in MATLAB