diff options
author | Mi Zhang <mzhang@email.wm.edu> | 2012-09-11 16:03:41 -0400 |
---|---|---|
committer | Mi Zhang <mzhang@email.wm.edu> | 2012-09-11 16:03:41 -0400 |
commit | d1d7a486cc70665dafe64aaddd44c58e228815b0 (patch) | |
tree | acbf530230d6860c9a85f5f1d67d0e445dde5192 /fitGaussian1D.m | |
download | beam_profiler-d1d7a486cc70665dafe64aaddd44c58e228815b0.tar.gz beam_profiler-d1d7a486cc70665dafe64aaddd44c58e228815b0.zip |
initial commit
Diffstat (limited to 'fitGaussian1D.m')
-rw-r--r-- | fitGaussian1D.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fitGaussian1D.m b/fitGaussian1D.m new file mode 100644 index 0000000..b3fbb56 --- /dev/null +++ b/fitGaussian1D.m @@ -0,0 +1,11 @@ +function [z] = fitGaussian1D(p,v,x) + +cx = p(1); +wx = p(2); +amp = p(3); +background = p(4); + +zx = amp*exp(-2*(x-cx).^2./(wx^2)) - v - background; + + +z = sum(zx.^2); |