Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ggbins = linspace(100,160,31);
- [ggcounts] = histc(mgg,ggbins);
- bar(ggbins,ggcounts,'histc');
- ggx = linspace(101,159,30);
- ggy = ggcounts(1:30);
- [ggxData, ggyData] = prepareCurveData(ggx,ggy);
- ic = [0.1 0.1 0.1 125];
- options = optimset('lsqcurvefit');
- options.MaxFunEvals = 10000;
- lb = [ -20 -20 0 120];
- ub =[20 20 10000 130];
- [newparam,resnorm,residual,exitflag,output,lambda,jacobian] = lsqcurvefit(@ggfunction,ic,ggxData,ggyData,lb,ub,options);
- y2 = ggfunction(newparam,ggxData);
- hold on;
- plot(ggxData,y2,'r');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement