Matlab rook here,(adsbygoogle = window.adsbygoogle || []).push({});

Suppose I'd want to plot the Gaussian for 10 different values for n:

And then I'll type gauss(3,10) to plot 10 curves in the interval [-3,3]Code (Text):function gauss(c,n) = plot_gaussian.m

x=-1*c:0.1:c;

gauss(x,j)=sqrt(j./pi)*exp(-1*j.*x.^2);

for j=1:n

plot(x,y)

end

Also, if I'd want to plot in 10 different colors, how can I manage that?

Thanks in advance.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab Gaussian

Loading...

Similar Threads - Matlab Gaussian | Date |
---|---|

How to program this in Matlab | Feb 28, 2018 |

Curl of Gaussian image derivatives matlab | Jan 20, 2012 |

[Matlab] FFT Gaussian x-space -> p-space scalings. | Jul 24, 2010 |

Please help me with Gaussian Distribution and central limit theorem in matlab | May 3, 2008 |

5-point Gaussian Quadrature using constructed approximant in Matlab | Mar 30, 2008 |

**Physics Forums - The Fusion of Science and Community**