Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. ggbins = linspace(100,160,31);
  2. [ggcounts] = histc(mgg,ggbins);
  3. bar(ggbins,ggcounts,'histc');
  4. ggx = linspace(101,159,30);
  5. ggy = ggcounts(1:30);
  6. [ggxData, ggyData] = prepareCurveData(ggx,ggy);
  7.  
  8. ic = [0.1 0.1 0.1 125];
  9. options = optimset('lsqcurvefit');
  10. options.MaxFunEvals = 10000;
  11. lb = [ -20 -20 0 120];
  12. ub =[20 20 10000 130];
  13. [newparam,resnorm,residual,exitflag,output,lambda,jacobian] = lsqcurvefit(@ggfunction,ic,ggxData,ggyData,lb,ub,options);
  14. y2 = ggfunction(newparam,ggxData);
  15. hold on;
  16. plot(ggxData,y2,'r');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement