I have a set of noisy data and want to fit a custom equation though it in MATLAB. Next I would take the values of the coefficients and utilize them in my algorithm. However I am stuck and I cant figure out why. I use a non linear equation a+b*log10(x1-dcos(alpha-x2)) where x1,x2 and the response value are known. First problem is the coefficients of a ,b, and alpha must be bounded. alpha here being in degrees can only vary from 0 to 360 for example.I dont know how to achieve this using curve fitting toolbox.
I have also tried other options like non linear regression techniques in MATLAB( fitnlm,lsqcurvefit etc) which proved to be disappointing as i cant have bounds over these variables. So in spite of fit being quite good, the coefficients are way too bad.
So, Question 1 : How do I fit multiple variables using curve fitting ? Question 2 : If thats not possible then what other techiniques can I use except non linear regression .
Many thnaks in advance ! Have a great day !
cftool
until you get it right, then use the "export code" function to learn how to do it programmatically. – Dev-iL