polynomial regression of a given function
Afficher commentaires plus anciens
i am trying to write a function which produces the regression polynomial of degree 2 for a given datapoints (x and f(x) where f is the function to be approximated). this is what i wrote !! the code gives me 0 errors but i can not plot the results for some reasons that i dont know
x=input('Enter the x coordinates');
y=input('Enter the y coordinates');
n=input('Enter the order of the polynomial');
coeff=polyfit(x,y,n);
p = polyfit(x,y,n);
plot p;
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Polynomials 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!