How do I provide a function or script name as the fitting model for the Curve Fitting Toolbox 1.1 (R13)?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
For example, for NLINFIT in the Statistics Toolbox, I can provide a function name as our fit model.
Akzeptierte Antwort
MathWorks Support Team
am 22 Jan. 2010
If you use the custom equation option in CFTOOL, you can specify a function name which takes xdata and some parameters for fitting. You should write your function in the following form:
function y = custq(a,b,c,x)
y = a*x.^2 + b*x + c
Then from the command prompt, use the following commands:
f = fittype('custq(a,b,c,x)');
fo = fit(xdata,ydata,f);
OR, in the CFTOOL GUI you can put
custq(a,b,c,x)
in the custom equation field.
You have to specify the parameters along with the function name, and the coefficients you are looking for need to be scalar. Only the xdata "x" may be a vector. Also, make sure that the function accepts a vector 'x'.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!