I have fitted my data with a gaussion function. the curve is basically lying in first coordinate and not starting from zero. I want to calculate the value of x for y=0 (x would then definitely come in 2nd coordinate). How to find this value of x. In figure, the first fitted curve (not starting from zero)
fun1 = @(p,xdata) p(1).*(1-exp(-xdata./p(2)))+5000;
I want to a value of x for y=0 (when curve touches x axis). How to find it. Any lead will be appricated.

 채택된 답변

Star Strider
Star Strider 2018년 1월 16일

0 개 추천

Once you have your fitted ‘p’ values, you can find the x value at y=0 with the fzero function.
Try this:
fun1 = @(p,xdata) p(1).*(1-exp(-xdata./p(2)))+5000;
x_intercept = fzero(@(xdata) fun1(p,xdata), -1);

댓글 수: 2

Raju
Raju 2018년 1월 16일
Thank you so much for your answer. It's working.
Star Strider
Star Strider 2018년 1월 16일
As always, my pleasure.
If my Answer helped you solve your problem, please Accept it!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

2018년 1월 16일

댓글:

2018년 1월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by