clear all, close all % Input data and other problem dependent functions and parameters. xvec = [0:1:11]'; yvec = [260 992 2717 5341 8224 13195 21355 32196 35230 43352 45524 47572]'; b_0 = [yvec(1), max(yvec), 1]'; % use analytic solution format long g; b_opt = nlinfit(xvec,yvec,@logistic,b_0) % use numerical solution b_opt = nlinfit(xvec,yvec,@num_logistic,b_0)