Hello,
I have a two input, one output custom equation that I am trying to define the coefficients using field data. The code I am using is as below
fo = fitoptions('Method','NonlinearLeastSquares', 'Lower',[0 0 0 0 ]', 'Upper', [5 5 4000 200 ], 'StartPoint',[0.1 0.1 0 0], 'MaxIter',4000);
ft = fittype( @(a,b,c,d,m,n) a.*(exp(b.*m)-1)+c+d.*n.^2,'independent', {'m', 'n'}, 'options', fo);
f = fit( M, N,Q, ft);
M and N are variables. a, b,c,d need to be defined.
When I run it, I get the following error:
Error using fit>iParseOptionalArgs (line 965)
The properties, PROP1, PROP2, ...
strings.
Error in fit (line 105)
[useroptions, useroptargs, probparams] = iParseOptionalArgs(
varargin{:} );
Error in FirstTryWithFlowRate (line 106)
f = fit( M, N,Q, ft, fo);
Any ideas on what might be causing this? I do not have any problem when I have only one independent variable. I also don't have any problem when I do it through the Curve Fitting application. But I need to automate the process, so I need to do it via script.
Thanks