Problem running linear fit y= m*x

how do you run a linear fit for y= m*x. I don't want to use polyfit(x,y,1) as this gives y=mx+b.

回答 (1 件)

Star Strider
Star Strider 2018 年 4 月 22 日

0 投票

Use the mldivide,\ (link) function:

m = x(:)\y(:);

カテゴリ

ヘルプ センター および File ExchangeLinear and Nonlinear Regression についてさらに検索

質問済み:

2018 年 4 月 22 日

回答済み:

2018 年 4 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by