I have the coefficients of a polynomial of order 12 given to me using polyfit (it was fitted to model a probability density function). I now need to use the given polynomial f(x), multiply it by x^2, and integrate it over a given boundary.

I have tried using the integral function: integral(fun,xmin,xmax), where:fun = @(x) poly2sym(f) and f is the coefficients given by polyfit, but this doesn't work.