# NOT RUN {
x = seq(5000, 5003, length.out=200)
y = gauss3func(x, 0.3, 0.5, 0.4, 5001.5, 5002, 5000.4, 0.1, 0.1, 0.13)
y = rnorm(200, mean=y, sd=0.01)
plot(x, y)
abline(v=c(5000.8, 5001.2, 5001.75, 5002.3))
pars = fit3gauss(x, y, c(5000, 5000.8), c(5001.2, 5001.75), c(5001.75, 5002.3))
fitted = gauss1func(x, pars$amp, pars$mu, pars$sig)
lines(x, fitted, col=2)
# }
Run the code above in your browser using DataLab