fit() throwing exception 'Error using cfit/subsr​ef>iParent​hesesRefer​ence (line 36) Too many inputs to CFIT/SUBSREF.'

I am trying to use the fit() function.
botEdgeFit = fit(botEdgeNew(:,1), botEdgeNew(:,2), 'poly2');
However it throws the exception:
Error using cfit/subsref>iParenthesesReference (line 36)
'Too many inputs to CFIT/SUBSREF.
Error in cfit/subsref (line 15)
out = iParenthesesReference( obj, currsubs );
Error in Overlaying2 (line 320)
botEdgeFit = fit(botEdgeNew(:,1), botEdgeNew(:,2), 'poly2');
The problem is that sometimes it works, and sometimes it doesn't. I have tried it multiple times and can promise you I am not changing a single thing. I honestly have no idea what's going on here. The inputs are the same size:
>> size(botEdgeNew(:,1))
ans =
857 1
>> size(botEdgeNew(:,2))
ans =
857 1
Any help would be greatly appreciated. Thanks!

3 Kommentare

Would have to see the actual data for each of case that works and that doesn't...I would venture a guess (Crystal Ball Toolbox not yet having been released) perhaps in the case that fails you may have a cell array which has gotten expanded into comma-separated list, thus triggering the message.
botEdgeNew is a. 857x2 array of doubles. I have no idea how it could be expanded into a comma-separated list.
Well, again, we don't either because we don't have anything to work with...need a sample case that fails as a minimum that somebody can run here...and as said, w/o more than just one line in isolation we can't tell anything about what other code there is ahead that could have done something inadvertently...as said, didn't/don't have the Crystal Ball Toolbox.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2020a

Gefragt:

am 31 Jul. 2020

Kommentiert:

dpb
am 2 Aug. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by