Exponential Curve Fitting Script
조회 수: 16 (최근 30일)
이전 댓글 표시
I have some learning data that I would like to fit to a single exponential by writing a script. In particular I want to retrieve the rate of learning from the exponential (i.e., probably the decay constant) for my analysis. I really have no idea where to start.
Thanks!
댓글 수: 0
답변 (1개)
Star Strider
2014년 9월 4일
Where you start depends on the functions you have available. The easiest nonlinear curve fitting functions are the Statistics Toolbox nlinfit or the Optimization Toolbox function lsqcurvefit. If you have none of those, fminsearch will work with an interim function to calculate the sum-of-squares. (I don’t have the Curve Fitting Toolbox, so I can’t help you with it.)
This function (or a slightly altered version depending on your data and your assumptions) will work:
expfn = @(b,x) b(1).*exp(b(2).*x);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!