How to use regression?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Ghazal Hnr
il 12 Mar 2017
Commentato: Walter Roberson
il 12 Mar 2017
I have 2 vectors and i want to obtain a correlation between them like y=ax+b by using regression, but i don't know how to use this code. would anyone help me with this?
0 Commenti
Risposta accettata
Walter Roberson
il 12 Mar 2017
coeffs = polyfit(FirstVector, SecondVector, 1);
Then coeffs(1) will be your a, and coeffs(2) will be your b.
4 Commenti
Walter Roberson
il 12 Mar 2017
Note that when I say "a different way of writing the same thing", I mean that polyfit() really does construct those matrices and use the \ operator.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Descriptive Statistics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!