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)