summaryrefslogtreecommitdiff
path: root/fit_image.m
diff options
context:
space:
mode:
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 ...
+ );
+