How to hold parameters in nlinfit (Matlab)
If you are using nlinfit to fit your data in Matlab, maybe you are interested (as I was) in finding an easy way to hold some of your parameters (by default there no option to do it). So how to hold, to fix some of the parameters? Looking on the internet I found this "official" solution link coming directly from the Mathworks support. It consists in re-writing a new version of nlinfit , called nlinfitsome , that fits only some of parameters. The solution is pretty nice and clever but it has a drawback. The reason I use nlinfit over lsqcurvefit is because it makes relatively easy to get the error bars, however with the proposed solution this advantage is lost so I modified nlinfitsome to address this specific problem. My function , called mod_nlinfit , has exactly the same arguments of nlinfit and gives you as output the parameters and their error bars. I know that nlinfit has a richer output, but for my needs, having the parameters and error bars is enough. T...