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
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
this is what i get.
??? XDATA must be a column vector.
Error in ==> fit at 95
errstr =
handleerr('curvefit:fit:xDataMustBeColumnVector',
...
% Did you type
fit -all
% or
which fit -all
% as John said?
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
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