Template Fitting using lsqcurvefit
Show older comments
So what I am trying to do it fit a tempalte with 3000 data points to an experimental data set. I am using lsqcurvefit to do this. I need to get three parameters back, one adjusts my amplitude, one shifts the matrix right or left, the other adds a baseline to my data. Getting lsqcurvefit to solve for the amplitude and baseline is simple, but having it solve for the shift is not as easy. My function uses circshift to move the tempalte right or left. The problem with lsqcurvefit is that I cannot figure out how to make it adjust the second value it is searching for to an integer. I am trying to pass it this,
stepDiff=[1e-3 1 1e-3];
opts = optimset('Algorithm', 'levenberg-marquardt','FinDiffRelStep',stepDiff);
for my options. I want to be able to have the 1st and 3rd variable be able to be non-integers, but the second one constrained to be an integer value. Any thoughts would be greatly appreciated.
Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Choose a Solver in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!