Quadratic interpolation of an N dim array
Mostra commenti meno recenti
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!
Risposta accettata
Più risposte (1)
Walter Roberson
il 26 Apr 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.
Categorie
Scopri di più su Interpolation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!