Polyfit with weights for not allowed points
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a multiple matrices that I'm trying to fit with multiple polyfit functions (see picture). I'd like to combine the matrices in one single matrix and then fit them with one polyfit function. The issue is that some columns of the matrices are empty (hence the curves in the picture don't cover the whole range), therefore I cannot combine all them together.
I hope this is clear. I would really appreciate some help. Thanks!
0 commentaires
Réponses (2)
Matt J
le 18 Déc 2016
Modifié(e) : Matt J
le 18 Déc 2016
There is nothing to be gained by combining the data, since polyfit will only process one pair of vectors (x,y) per call.
Jos (10584)
le 18 Déc 2016
You can simply concatenate the data into a single vector
% xk, yk are your data sets. concatenate them into a single vector
x_combined = [x1 x2 x3] % assuming sets are row vectors
y_combined = [y1 y2 y3]
p = polyfit(x_combined, y_combined, ...)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!