summaryrefslogtreecommitdiff
path: root/fit_image.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 23:35:55 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 23:40:53 -0400
commit68fd0602616f8c24e8895e74d9b3d77077492b0e (patch)
tree4d870265120774906af944e9ab18010780b24b2b /fit_image.m
parent9ee328d6a556862710428f115e75de05f9c3eb9c (diff)
downloadbeam_profiler-68fd0602616f8c24e8895e74d9b3d77077492b0e.tar.gz
beam_profiler-68fd0602616f8c24e8895e74d9b3d77077492b0e.zip
use of more general fit image function
Diffstat (limited to 'fit_image.m')
-rw-r--r--fit_image.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/fit_image.m b/fit_image.m
new file mode 100644
index 0000000..e682e4d
--- /dev/null
+++ b/fit_image.m
@@ -0,0 +1,11 @@
+function fit_params=fit_image(f,init_params,X,Y,img, pLowBound, pUpperBound, options)
+
+%options = optimset('lsqnonlin');
+%options.Display = 'iter';
+%options.TolFun = tolerance;
+
+fit_params = lsqnonlin( ...
+ @(p) Gaussian2D(p,X,Y) - img, ...
+ init_params,pLowBound,pUpperBound,options ...
+ );
+