Function for power regression

4 ビュー (過去 30 日間)
Shatha
Shatha 2021 年 4 月 4 日
コメント済み: Shatha 2021 年 4 月 5 日
i wanted to use power regression for values of vibrating mass equation:
the values are:
m=[0.0200 0.5000 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000]
T=[0.2000 0.3100 0.4600 0.5300 0.6200 0.7100 0.7600 0.8400 0.9100]
but i can't figure out that right function for power regression, would apprecaite some help
  2 件のコメント
David Goodmanson
David Goodmanson 2021 年 4 月 5 日
編集済み: David Goodmanson 2021 年 4 月 5 日
Hi Shatha,
First of all you need to fix the second value of m, which should be .0500 not .5000.
If T is proportional to sqrt(m), then T^2 is proportional to m. So
plot(m,T.^2,'-o')
shows a nice straight line (almost) which you can fit with linear regression.
Shatha
Shatha 2021 年 4 月 5 日
thank you for pointing out the error in the second value i missed that, i am still looking though for a function that gives me the values of a and b such that for a power regression model

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

回答 (1 件)

David Hill
David Hill 2021 年 4 月 5 日
g=fit(m',T','a*x^b','StartPoint',[.02 .2]);
  1 件のコメント
Shatha
Shatha 2021 年 4 月 5 日
this worked!
thank you very much

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

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by