Exponential Fitting function not plotting the same information as the data points?
이전 댓글 표시
Hi, my brain is pickled with this one. Below are the two graphs I have plotted with exp2 function. The points do not match the curve, and this is ultimately changing my entire answer, as it is giving the wrong values out, and I cannot understand why?
Here is the code I am using, both graphs plot a concentration against time, but yet give different results:
CH4_fit = fit(Res_time, CH4_exp, 'exp2');
CH4_coeff = coeffvalues(CH4_fit); %Co-efficient values for exponential fitting
CH4_pred =(CH4_coeff(1)*exp(CH4_coeff(2)*Res_time)) + ...
(CH4_coeff(3)*exp(CH4_coeff(4)*Res_time));
plot(Res_time,CH4_exp, Res_time, CH4_pred);
Can I just added that the exact same data was run on different computers, and it gave the same equation co-efficients exactly (to 4.dp) and the same times, but yet still outputs different concentrations on my version? I have the R2018b, and I have just used default settings (don't know how to change anything, so I definitely haven't).
댓글 수: 7
David Goodmanson
2019년 2월 14일
편집: David Goodmanson
2019년 2월 15일
Hi Lewis,
could you explain a bit more? Is the second plot a good fit done on another computer?
Lewis Brammeld
2019년 2월 14일
David Goodmanson
2019년 2월 14일
so are you saying the fit in the second image (fig 5) is not good enough?
Lewis Brammeld
2019년 2월 14일
David Goodmanson
2019년 2월 14일
편집: David Goodmanson
2019년 2월 14일
I don't know what you mean by 'the fit for the line' (is it in a buried plot?). I think for anyone to weigh in with an opinion you will have to provide more detail on the problem.
John D'Errico
2019년 2월 14일
편집: John D'Errico
2019년 2월 14일
We don't have your data. That makes it impossible to really help you. Please attach the data points as a .mat file to a comment.
It may be true that a picture is worth a thousand words, but then real data? More like 10 thousand words. ;-)
Lewis Brammeld
2019년 2월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
