Fit the dependences by straight lines passing through the origin.

7 ビュー (過去 30 日間)
Emilia Oana Mis
Emilia Oana Mis 2021 年 12 月 9 日
回答済み: Krishna 2024 年 2 月 11 日
Fit the dependences by straight lines passing through the origin. Denote k1 and k2 the slopes.

回答 (1 件)

Krishna
Krishna 2024 年 2 月 11 日
Hey Emilia,
It seems you want to fit a linear regression model for 2 features without a bias term so that it passes through the origin. The k1 and k2 slope that you mentioned are nothing but the weights of these features. Your mathematical equation for the function would be like,
y = w1x1 + w2x2
To do this you can use the fitlm function and make the 'Intercept' as false.
dlm = fitlm(X,y,'Intercept',false);
Please go through the following documentation to learn more,
And to learn how to fit linear regression model in MATLAB refer to this documentation,
Hope this helps.

カテゴリ

Help Center および File ExchangeRegression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by