i am trying to build a code that plot gauss distributions for diferent parameteres, but i am getting something wrong. I have wrote this code:
from numpy import zeros,empty,array,loadtxt,dot
import numpy as np
from math import log,exp,sin,cos,sqrt,pi,e,sqrt
from pylab import plot,show,ylim,ylabel,xlabel
n=10
#definindo os vetores posição e os vetores f que irão armazenar o valor da função no ponto.
f= zeros(n+1,float)
f1=zeros(n+1,float)
f2= zeros(n+1,float)
f3= zeros(n+1,float)
x= zeros(n+1,float)
#Definindo a função gaussiana
def gauss(xi,xf,sig,a):
step=(xf-xi)/n
for k in range(n+1):
f[k]=(1.0/(sqrt(2*pi)*sig))*exp((-(xi+step*k-a)**2)/(2*sig**2))
x[k]=xi+step*k
print(f)
return f
# A partir de agora iremos chamar a função gauss três vezes para plotar a função para diferentes valores dos parametros
f1=gauss(-5,5,5,0)
f2=gauss(-5,5,2,0)
plot(x,f1)
plot(x,f2)
show()
But when i plot the functions f1 and f2, i get the exact same graph.
def gauss:*sig /sig = 1Sosighas no influence on the result