Issue curve fitting in MATLAB, possibly due to variables being several orders of magnitude different
I am trying to use lsqcurvefit in MATLAB to fit an equation to some data in order to solve for a couple variables. I have included the part of the code below that covers this. I am trying to solve for coeff(1) and coeff(2), The problem is that when I run lsqcurvefit, it is just using whatever my initial guesses are and outputting that as the solution. I suspect it is because my values for the coefficients will be several orders of magnitude different. You can kind of get an idea for this by looking at coeff0. Has anyone else run into this problem and/or do you know how to work around it? Any insight would be greatly appreciated.
How to curvefit in MATLAB when I have multiple dependent variables
I have the equations that are shown in the images. I have a set of experimental data for Vp and Ip. Vp is my xdata and Ip is my ydata. I want to use a curve fitter to fit Equation 7 to my Ip vs Vp data while optimizing my n0 and xi values. I am trying to use lsqcurvefit since the paper I am referencing suggests the Levenberg-Marquardt method. My issue is with the V1 term. I am using fsolve to solve for V1 for Equation 8 so I have different V1 values for my Vp values. Lsqcurvefit wants an input of (fun, x0, xdata, ydata). Is there a way for me to let it know it needs to use different V1 values for different Vp values or is there a way to let the curve fit know that there are two dependent functions?
fails to fit a custom function in matlab
Thanks for reading my question. I try to fit a set of data in matlab by a custum function, which is no more than a Gaussian distribution with an additional $x^d$ term. However, an error is encountered. Despite many efforts, I can’t solve this problem.