fittype with user defined fit-function
1 view (last 30 days)
Show older comments
I have data where I create a fit from:
fit_curve=fit(x,y,'smoothingspline');
% x, y long vectors
This fit I use to define a fittype:
ft=fittype(@(a,b,x) a+fit_curve(x+b));
this fittype I use in another fitfunction
fit_2=fit(k,l,ft, 'StartPoint', [k(2) l(2));
% k, l vectors with 3 elements
this makes a beautiful fit. But if I change the fittype to
ft=fittype(@(a,b,x) a*fit_curve(x*b));
then the fit_2 is totally wrong.
I tried already .* or only replace one of the + by *. How to solve the problem? Let me know, if you need more information or the plots of the curves.
0 Comments
Answers (0)
See Also
Categories
Find more on Linear and Nonlinear Regression 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!