Curve fitting problems regarding complex values

Hi all, I got a question for you. It is about how to curve fitting and what values are the best in my case. The following is part of my codes. I am using lsqcurvefit, which can not deal with complex values.

Thus, I have to convert complex values to real, but the problem is which method is the best. (1) only the real part of complex values is considered and handled, the imaginary part is ignored. (2) instead of using real, we could choose to use absolute values.

Another question is if we give different initial values for these coefficients, we will get different best values for them. But which ones are the best? It depends on what conditions.

x0=[1.3E-03; 0.2; 5.4; 1]
[x,resnorm] = lsqcurvefit(@myfun,x0,xdata,ydata)
function F = myfun(x,xdata)
F =x(1)*(1-exp(-real(power(((xdata-x(2))/x(3)),x(4)))))


  • Can anyone remove one of my 2 posts? I have no idea what happended to the website and somehow my post was published twice. Thanks a lot.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion