Help Fit line / curve to data

1 回表示 (過去 30 日間)
RuiQi
RuiQi 2016 年 11 月 23 日
コメント済み: Walter Roberson 2016 年 11 月 23 日
Hello, I am trying to find the equation of a best fit line for this data that I have below. I tried using polynomial fit with degree 2 but the results are unsatisfactory. I was wondering if anyone can offer any suggestions. Based on the scatter plot below, id like the results to be a curve that is steep at a steep slope at the beginning and gentle later.
  3 件のコメント
RuiQi
RuiQi 2016 年 11 月 23 日
Hi thanks ! But id like to extract the complete equation of the curve as well.
KSSV
KSSV 2016 年 11 月 23 日
編集済み: KSSV 2016 年 11 月 23 日
h = isline ;
h will be having the xdata and ydata.It fit's a straight line.

サインインしてコメントする。

回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 11 月 23 日
I suggest trying to fit it to y = A * exp(-B*x) + C
If you assume that C is 0 then that would be a fit of y = A * exp(-B*x) which would be
log(y) = log(A) - B * x
which would be a linear fit to find B and log(A).
  1 件のコメント
RuiQi
RuiQi 2016 年 11 月 23 日
Cool ! I would need to exponentiate log(A) so that I can get back A right ? And as for B I don't need to do anything to it

サインインしてコメントする。


KSSV
KSSV 2016 年 11 月 23 日
doc lscurvefit.
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 11 月 23 日
lscurvefit needs to be told what model to fit against.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by