MATLAB: How to constrain a vector’s value within a nonlinear fit

curve fittingnonlinearvector

I am fitting a set of data using nlinfit as magnetic dipoles and I want my fitted parameters to be only positive.
How do I make this constraint?

Best Answer

Put them in the fittype equation as parameters-squared.
Best wishes
Torsten.
Related Question