Get function handle of fit function in matlab and assign fit parameters
问题 I'm fitting custom functions to my data. After obtaining the fit I would like to get something like a function handle of my fit function including the parameters set to the ones found by the fit. I know I can get the model with formula(fit) and I can get the parameters with coeffvalues(fit) but is there any easy way to combine the two in one step? 回答1: This little loop will do the trick: x = (1:100).'; %' y = 1*x.^5 + 2*x.^4 + 3*x.^3 + 4*x.^2 + 5*x + 6; fitobject = fit(x,y,'poly5'); cvalues =