Error using cfit/subsref when trying to fit a smoothingspline

4 views (last 30 days)
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?

Answers (0)

Categories

Find more on Linear and Nonlinear Regression in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!