How can I find the coeficients alpha, beta of the simple linear regression, using "\" operator
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can I find the coeficients alpha, beta for the X coordinates of the simple linear regression, using "\" operator?
0 commentaires
Réponses (1)
Torsten
le 10 Déc 2022
x = (0:0.1:1).';
y = 3*x + 4 + 0.01*randn(numel(x),1);
A = [x,ones(size(x))];
b = y;
coeffs = A\b;
coeffs(1)
coeffs(2)
Voir également
Catégories
En savoir plus sur Linear Regression dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!