fittype with user defined fit-function

1 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by