Hi everyone, thank you for your time,
I am currently working on a code that inputs real-life indentation data to fit them through a curve fitting toolbox. The relevant code portion is as below:
f1 = fittype('a0+(a1-a0)*((0.491*exp(-0.908*sqrt((abs(a3)*x)/(C0^2))))+(0.509*exp(-1.679*sqrt((abs(a3)*x)/(C0^2)))))','problem','C0')
f = fit( Hx, Hy, f1, 'problem', C0, 'lower',[0,0,0])
As you can see, I have not specified starting conditions, because we work with different tissues that each have different local minima (which creates non-fits). So I am letting MatLab randomize the starting points ( coeffiecient a0,a1,a3) to get global minima.
I am currently using r2 comparison to choose the best results. What I am also interested is recording what initial values Matlab chose for a0,a1 and a3 for the better runs (higher r2) so that I can make separate codes for particular tissues with preset inital guesses.
Thank you all for your time.