# Complex variable curve fitting

Hello,
I am trying to fit the following complex equation by using 'lsqcurvefit' function.
F = 0.008 + x(1)/(4*pi^2*f^2*x(1)^2*x(2)^2 + 1) -...
1i*2*pi*f*x(1)^2*x(2)/((4*pi^2*f^2*x(1)^2*x(2)^2 + 1)) +...
x(3)/(4*pi^2*f^2*x(3)^2*x(2)^2 + 1)-...
1i*2*pi*f*x(3)^2*x(2)/((4*pi^2*f^2*x(3)^2*x(2)^2 + 1));

Every time I got the following message:
Error in ==> myfun at 2
F = 0.008 + x(1)/(4*pi^2*f^2*x(1)^2*x(2)^2 + 1) -...

Error in ==> lsqcurvefit at 209
initVals.F = feval(funfcn_x_xdata{3},xCurrent,XDATA,varargin{:});

Error in ==> eis_fitting at 22
[x resnorm] = lsqcurvefit (@myfun,x0,f,z);

Caused by:
Failure in initial user-supplied objective function evaluation. LSQCURVEFIT cannot
continue.

Actually I am new in Matlab. I will really appreciate if anyone can help me to find a way to solve this problem.
.

## Relevant Pages

• Re: lsqcurvefit bounds influence fitting result
... Without analyzing your particular function, I can say that many, perhaps most, realistic fitting problems have many local minima. ... Changing the bounds causes lsqcurvefit to reach different local answers. ... If you have a Global Optimization Toolbox license, you can use MultiStart to search for a global minimum very easily. ... a upper bound but the results of the fit vary quite drastically ...
(comp.soft-sys.matlab)
• Re: Fitting LSQCURVEFIT
... I have been using LSQCURVEFIT for one set of model and actual data by ... varying TH,F and Z and want to fit it to experimental data, where F ... The model data are the same metrics as the experimental data simulated ...
(comp.soft-sys.matlab)
• Fitting LSQCURVEFIT
... I have been using LSQCURVEFIT for one set of model and actual data by ... but don't know how to input multiple data ... varying TH,F and Z and want to fit it to experimental data, where F ... Should I create a sum of the differences function of all the data as ...
(comp.soft-sys.matlab)
• transistor parameter optimization-lsqcurvefit
... I am having problems with the lsqcurvefit function. ... the equations which will help me to fit the mathematical model to ... The mathematical model that I implemented in matlab is correct ...
(comp.soft-sys.matlab)
• Re: messages returned using LSQCURVEFIT
... John D'Errico wrote: ... I am using LSQCURVEFIT to fit a curve to my data and although ... within reason. ...
(comp.soft-sys.matlab)