Error using cfit/subsref when trying to fit a smoothingspline
3 次查看(过去 30 天)
显示 更早的评论
According to documentation, if a fittype is specified, the output becomes [curve,gof] = fit(x,y,fttype)
My code is shown as follows:
A = importdata('exp65_C1.SS');
[x,y] = prepareCurveData(A(:,1),A(:,2));
[fit_o,~] = fit(x,y,'smoothingspline');
I get the error:
Error using cfit/subsref
Too many output arguments.
When I execute the fit line. I checked that x and y are both single column vectors of size 12776x1, and both have the same dimensions. The data goes from 0 to 0.83 for x, and 0 to 726 for y.
When I remove the ~ since it said I have too many output arguments, it gives this error instead:
Error using cfit/subsref>iParenthesesReference (line 36)
Too many inputs to CFIT/SUBSREF.
Error in cfit/subsref (line 15)
out = iParenthesesReference( obj, currsubs );
Which makes sense since fttype requires more than one output. Same error if I don't specify an output at all.
What is going on?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!