Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

curve fit error: Too many input arguments

293 views
Skip to first unread message

Elangovan

unread,
Jun 25, 2009, 12:51:01 PM6/25/09
to
when i try to do fitting using cftool, it gives me 'Too many input arguments' error.

even when i do fit on 2 simple variables , its the same error.
x= 1:1000;
y = 1:1:1000;
>> cfun = fit(x,y,'poly1');
??? Error using ==> fit
Too many input arguments.


I am really frustrated by this error. Please help

John D'Errico

unread,
Jun 25, 2009, 1:15:05 PM6/25/09
to
"Elangovan " <ea...@njit.edu> wrote in message <h209tl$8ga$1...@fred.mathworks.com>...

When you type

which fit -all

What does it tell you? Do not name scripts or functions
with a name like that when you plan on using the
function of that name.

John

Elangovan

unread,
Jun 25, 2009, 4:31:01 PM6/25/09
to
When i do fit -all

this is what i get.

??? XDATA must be a column vector.

Error in ==> fit at 95
errstr =
handleerr('curvefit:fit:xDataMustBeColumnVector',
...

someone

unread,
Jun 25, 2009, 4:53:01 PM6/25/09
to
"Elangovan " <ea...@njit.edu> wrote in message <h20mq5$61e$1...@fred.mathworks.com>...

% Did you type

fit -all

% or

which fit -all

% as John said?

Elangovan

unread,
Jun 25, 2009, 5:05:02 PM6/25/09
to
Last time i did just fit -all

This is what i get if i do
which fit -all
C:\Users\pranav\Documents\MATLAB\2001\P5\All Data\fit.m
C:\Program Files\MATLAB\R2008a\toolbox\stats\@gmdistribution\fit.m % gmdistribution method
C:\Program Files\MATLAB\R2008a\toolbox\curvefit\curvefit\fit.m % Shadowed

Also the error that i get when using cftool is

??? Undefined function or method 'genresults' for input arguments of type 'double'.

Error in ==> cftoolcreatefit at 66
results = cftoolFit.doFit( method );

Error in ==> cfswitchyard at 14
[varargout{1:nargout}]=feval(action,varargin{:});

Thanks,
Elan

John D'Errico

unread,
Jun 25, 2009, 6:05:02 PM6/25/09
to
"Elangovan " <ea...@njit.edu> wrote in message <h20opt$g7v$1...@fred.mathworks.com>...

> Last time i did just fit -all
>
> This is what i get if i do
> which fit -all
> C:\Users\pranav\Documents\MATLAB\2001\P5\All Data\fit.m
> C:\Program Files\MATLAB\R2008a\toolbox\stats\@gmdistribution\fit.m % gmdistribution method
> C:\Program Files\MATLAB\R2008a\toolbox\curvefit\curvefit\fit.m % Shadowed

As I said, you have named an m-file fit.m.

It is in the "All data" directory, exactly where
you would have put it.

Rename that file to something else, and all will
work. In the future avoid this type of error.

John

0 new messages