Curve fitting in MATLAB: different result form toolbox vs command line?
This is the data I am using for Y data: 0.577032413537833 0.288198874369377 0.192282280031568 0.143824619265244 0.114952782524097 0.0960518606520442 0.0824041879978560 0.0719078360110914 0.0640919744028295 0.0572120310249072 0.0519630635470660 0.0479380073164273 0.0443712721513307 X is simply the integer value from 1 to 13 and I know that this is power function of form a*x^b+c from running GUI cftool on MATLAB with rather high R-square value (1) To perform the fit on command line, I used: >> g = fittype('a*x^b+c','coeff',{'a','b','c'}) >> x=1:13; >> [c3,gof3] = fit(x',B3(:,1),g) This results