MATLAB: Can somebody help with curve fitting app custom equation problem please

curve fit appcurve fitting

Hello All,
Trying to use the curve fit app to fit a simple function (custom equation) to the x-y data attached (csv format). Matlab custom equation is:
y = f(x) = (2/(1.602e-19*(4.71e-3^2)*8.85e-14*10*Na))*(V-x)
I am attemtping to extract Na and V from the equation.
For some reason when I enter this function into the "custom equation" section of the curve fitting app the fit is extremely poor. However when I replace the Na value with 8e15, the fit becomes clear and a value for V is extracted accurately from the data (95% confidence). Isn't the purpose of the curve fit app to perform my manual guess for Na this in the first place?
Any help as to what I am doing wrong is much appreciated.
Thanks,
Mike

Best Answer

My suspicion is that your equation is overly complex for the data, so MATLAB is having a hard time guessing the right starting points. Open the 'Fit Options' (button under your custom equation) and provide reasonable guesses for your Na and V StartPoints.
One thing that might be compounding your issue is the scale of your data: 10e20. The default settings are way too small for data of this magnitude. If I change DiffMinChange to 1.0e5 and DiffMaxChange to 10e5, if performs the fit on its own.
You can also solve this manually if you want. See this post on how to get started.