Error using lsqncommon (line 67)

3 views (last 30 days)
C A
C A on 5 Oct 2021
I am trying to fit heat maps from biological cells. My code works for most of my cells but a few cells failed due to incorrect fitting parameters. I dont want to change the fitting parameters because they have been optimized for most cells. Can you please tell me how to proceed to the next cell when the code tries to fit the errenenous cells??
Error using lsqncommon (line 67)
The Levenberg-Marquardt algorithm does not handle bound constraints and the trust-region-reflective algorithm requires at least as many
equations as variables; aborting.
Error in lsqcurvefit (line 257)
lsqncommon(funfcn,xCurrent,lb,ub,options,defaultopt,caller,...
Error in FittingClass/FittingFunction (line 569)
x = lsqcurvefit(@Obj.generalizedgaussianfunction,x0,xdata,ydata,Obj.lb,Obj.ub,Obj.FitOptions);
Error in MainClass/CallingFunctionForFit (line 1331)
[iCell{iFrame}]=FitObj.FittingFunction(iCell{iFrame},signal,MaximumPeakNumber);
FYI:
properties (Access = protected)
FitOptions = optimoptions('lsqcurvefit','Display','off');
end
FitObj=FittingClass(Obj.rootdir,[]);
I can't post the code here because it is pretty long. Please tell me how to avoid the cells that gives out the above error.

Answers (0)

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by