I'm using the fitnlm function within Matlab to calculate three coefficients. To improve the results, I know that two of the coefficients need to be positive and the third to be from 0 - 360 degrees. How can I add these assumptions into the model? I've looked through the help files and can't seem to find anything that helps. The following is the code I have used:
modelfun = @(b,x)b(1)*(1/b(2)) - (b(1)/cp).*cos(Rays).*(cos(X1)*cos(b(3)) - sin(X1)*sin(b(3)));
beta0=[0.15 2.5 0];
mdl=fitnlm(X1,Y,modelfun,beta0)
Thanks for the help
James