% This function accepts binding data (Y) and returns a vector, Yhat, of fitted % binding values corresponding to the original ligand concentration data. % It also returns the fitting parameters KD and n. % The model Y = L^n/(L^n + KD^n) is used for this fit, which assumes ligand is in excess. function Yhat = Fit_KDn(C, x) KD = C(1); n = C(2); Yhat = (x.^n)./(x.^n + KD.^n);