Problem running linear fit y= m*x

6 ビュー (過去 30 日間)
hellafella
hellafella 2018 年 4 月 22 日
回答済み: Star Strider 2018 年 4 月 22 日
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 日

Use the mldivide,\ (link) function:

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

カテゴリ

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