Curve fitting with an if statement
이전 댓글 표시
I am using the curve fitting app on matlab to fit the following function to my data set:
y(x) = (a0*(1-exp(-b0*(x-c0))))+(a1*(1-exp(-b1*(x-c1))))
However, I would like to alter the equation to be:
y(x) = ((a0*(1-exp(-b0*(x-c0))))*u0)+((a1*(1-exp(-b1*(x-c1))))*u1)
with the following command
u0 = if(x<c0,0,1)
u1= if(x<c1,0,1)
i.e. y would equal 0 until x passes c0 and y(x) would equal the first part of the equation between c0 and c1 and the full model from c1 onwards.
Please see page three on the attached pdf under VO2 kinetics for a similar example.
Any help would be greatly appreciated.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!