fit type question for matlab

4 ビュー (過去 30 日間)
Alex M
Alex M 2016 年 3 月 2 日
編集済み: Alex M 2016 年 3 月 29 日
d

採用された回答

Jos (10584)
Jos (10584) 2016 年 3 月 2 日
A line that passes through the original has the equation y= a*x
Did you try using fittype and fit?
x=[-5 -4 -3 -2 -1 0 1 2 3 4 5 ];
y=[-478.4 -377.2 -278.6 -180.8 -84.5 0 85.25 181 278.2 377.5 479.2];
FITFUN = fittype('a*x')
FT = fit(x(:), y(:), FITFUN)
fittedY = FT([-6 6])
plot(x, y, 'bo', [-6 6], fittedY, 'rs-')

その他の回答 (0 件)

カテゴリ

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