I want to use fit in MATLAB for two dimensions.
I defined function separately and then called it with fittype
x has two columns!
f=fittype('@(x)myfun(beta1, beta2,beta3, x)')
and then customize in options my start point and algorithm.
then use [results, goodness]=fit(x, zdata,f, options), but I have a error
??? Too many inputs to FITTYPE function.
Error in ==> fit at 443 errstr = handleerr( errid, errmsg, suppresserr );
I also tried with [results, goodness]=fit([x(:,1), x(:,2)], zdata,f, options),
and still have the same problem.
I used fit -all
XDATA must be a matrix with one to two columns.
Error in ==> fit at 115 errstr = handleerr('curvefit:fit:xDataMustBeColumnVector', ...
for me sounds meaningles , since I have my x in two columns!!!!
and then which fit -all
/Applications/matlab/MATLAB_R2010a.app/toolbox/curvefit/curvefit/fit.m /Applications/matlab/MATLAB_R2010a.app/toolbox/stats/@ProbDistUnivParam/fit.m % ProbDistUnivParam method /Applications/matlab/MATLAB_R2010a.app/toolbox/stats/@NaiveBayes/fit.m % NaiveBayes method /Applications/matlab/MATLAB_R2010a.app/toolbox/stats/@gmdistribution/fit.m % gmdistribution method
could you please help me to use fit and fittype to fit my 2 dimension data?
{please don't introduce me meshgrid and other commands.}