Regression with some part of the array
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Nathalie
il 9 Mag 2014
Risposto: Jakob Sørensen
il 9 Mag 2014
Suppose I have x vector=[ 1 5 6 7 8 3 2 ] and corresponding y vector [2 9 4 6 4 5 6].
How to run regression for y on x for x>3.
Thanks.
0 Commenti
Risposta accettata
Jakob Sørensen
il 9 Mag 2014
x = [ 1 5 6 7 8 3 2 ];
y = [ 2 9 4 6 4 5 6 ];
idx = find(x > 3); % Returns the indexes where x is larger than 3
plotregression(x(idx), y(idx)); % Only uses the indexes of the vectors, where x were larger than 3
Replace with other regression methods, depending on what you need.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Linear Regression 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!