integral with vectoric varying coeficient
If you have a closed-form expression for the weighting function, you can use it  directly. Here, the weight is linear, so you can replace coef_vec by xand be ok.

fun = @(x)x.*exp(-x.^2).*log(x).^2;
q = integral(fun,1,10);


If not, an option is to define coef_vec on a larger interval, interpolate it with a suitable closed-form interpolating function, and use this under the integral.

Or, simply, evaluate the integral with a function like trapz. Here is a comparison, with close results

coef_vec=linspace(1,10,100);
fun0 = @(x)exp(-x.^2).*log(x).^2;
fun1 = @(x)x.*exp(-x.^2).*log(x).^2;
q1 = integral(fun1,1,10);

q2 = trapz(coef_vec,coef_vec.*fun0(coef_vec));
disp([q1 q2])

&gt;&gt;    0.0245    0.0245