Quadratic interpolation of an N dim array
Afficher commentaires plus anciens
Hello I would to know how I can perform a quadratic interpolation of an array using matlab ? it is worth mentioning that I am using interp1 for now. thank you!
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 26 Avr 2018
A = [x(:).^2, x(:), ones(numel(x),1)];
b = y;
coefficients = (A\b).';
This code is fine with x being either a row vector or column vector. The code expects that you are doing the quadratic fitting over each column of y independently (not over the rows.)
The array of coefficients that results will be N x 3 where N is the number of columns of y. The order of the coefficients will be the x^2 coefficient, then the x coefficient, then the constant.
Catégories
En savoir plus sur Interpolation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!